Where I describe how to use the GNU Linker wrapper capability and variable arguments to enhance printf()
for better debugging.
This recent post fascinated me. It describes a feature of the GNU linker called wrapping which allows you to replace an existing symbol (command) with a new version. The example describes adding a timestamp to printf()
. While, for me, this might be a solution looking for a problem, I really liked the idea. And at the very least wanted to add the concept to AVR_C.
Where I develop multiple versions of blink to better understand the timing API and bit-setting hardware API in the Pico C SDK in learning how to program the Pico in C.
The Pi Pico family of microcontroller boards have an incredible price/performance ratio. Ranging in price from $4 to $10, the Pico can provide a low-cost, high-performance dual-core Cortex M0-based board with or without wireless or installed headers (for easy breadboarding).
Updated: Feb 27, 2023: Where I install the tools and frameworks necessary to develop code in C on the RP2040 on a macOS platform.
Just as I did for the Linux platform, in this entry I’ll work through the steps required to be successful with developing code in C for the RP2040 on the Mac. Updated: This entry has been tested on both an Intel 2018 MacBook Pro and a M1 2020 Mac Mini.
Where I describe how to improve the performance of your programs by accessing the input/output (I/O) ports on the Arduino Uno, natively.
The Arduino framework and Uno hardware has performed an admirable job in abstracting much of the complexity of the ATmega328P into something which is easier to understand. This approach works well for a beginner in microcontrollers and embedded C programming. Once you begin to understand how the ATmega328P works, its not unusual to find the Arduino simplification is holding you back.
Where I demonstrate different methods of measuring a servo pulse to ensure it meets requirements.
In the entry on servos I discussed the specific pulse requirements to make a servo move. In a nutshell, a servo needs a positive pulse .5ms to 2.3ms in a 60Hz signal. Or to put it another way, it requires a 60Hz signal with a duty cycle ranging from 3% to ~14%.
Reference page for Bloom configuration and commonly used avr-gdb commands.
environments:
default:
debugTool:
name: "atmel-ice"
target:
name: "atmega328p"
physicalInterface: "debug-wire"
disableDebugWirePreDisconnect: false
manageDwenFuseBit: true
variantName: "atmega328p-pu"
debugServer:
name: "avr-gdb-rsp"
ipAddress: "127.0.0.1"
port: 1442
insight:
enabled: true
set history save on
set history size 10000
set history filename ~/.gdb_history
file main.elf
target remote :1442
set listsize 0
define cll
make
load main.elf
mon reset
refresh
list
end
Where I describe how to use the servos() interface in AVR C.
Servos are a powerful addition to the embedded programming toolkit as they enable motion. Not high-speed motion as in a electric motor, however, motion which can be easily controlled and typically in an arc or as angles. Servos are much more precise as to how they can move in comparison to electric motors. See Sources above for a few example tutorials as to how to use them.
Where I describe how to develop use pointers in AVR_C.
Pointers are introduced by “K&R” with the following comment “Pointers have been lumped with the goto statement as a marvelous way to create impossible- to-understand programs.” While pointers are simple in nature, they can become quite complex, quickly. I recommend going through the examples on this page, slowly and methodically as well as making changes and determine if the change had the effects you believed it would. I also recommend having a C Language reference manual open as well, as I won’t got through the usage.
Where I demonstrate the value of coding efficiency to reduce the cost of hardware.
In the another entry, I discussed code size, program space and RAM requirements and why they matter. Here are my thoughts from that page:
Where I demonstrate how to use the C Language data type struct and how to use it to simplify a program.
As programs become more complicated, its desirable to group common elements into a “block”, then debug that block and have the block serve as a single debugged element. For example, a function can serve as a block of code which performs a set of commands commonly used together. Once debugged, the function can be called instead of the individual commands, simplifying debugging and code management.