All projects

Arduino in assembly

ATmega328P, no C

status
Coursework
year
2026
area
Embedded

Programmed an ATmega328P in raw assembly to show Morse code and binary patterns on LEDs.

Details

  • Four routines in sequence: numbers in binary, my initials as alphabet positions (Z = 26, R = 18), Morse code, then a ping-pong light bouncing across the LEDs with logical shifts.
  • Morse for every count from 1 to 50: ZAI on odd counts, IAZ on even ones (parity by masking the low bit), plus a 5 on multiples of five, found by repeated subtraction since the AVR has no divide instruction.
  • All timing from nested busy-wait loops counted in clock cycles at 16 MHz, no timers or libraries, with dots, dashes and gaps at the standard 1:3:7 Morse ratios.
  • AVR assembly

keys

`
open or close the terminal
j k
next or previous section
0-9
jump to a numbered section (0 is the top)
gg G
top or bottom of the page
/
search everything (a grep in the terminal)
?
this list
esc
close whatever's open

(single-letter keys can clash with screen readers and your own shortcuts)

In the terminal, help lists the commands. Not all of them: try what you'd try on a real one, and eggs keeps score.