Bare-metal AVR examples for the Arduino Uno, comparing assembly, C, and Zig through direct register access.
Overview
Small ATmega328P examples written without the Arduino core or a hardware abstraction layer. The same LED programs are implemented in AVR assembly, C, and Zig to compare direct register access across languages.
Examples
- LED blink in AVR assembly and C
- LED sequences in assembly, C, and Zig
- SPI master setup in AVR assembly
Build
Per-example Makefiles use avr-gcc and avr-objcopy, with avrdude for flashing.
The Zig sequence example uses zig build. A Nix development
shell supplies the toolchain.
Stack
AVR assembly · C · Zig · ATmega328P · Nix