Four-channel audio synthesizer
Hardware and assembly firmware for an 8-bit micro with 8 kB of flash and 256 bytes of RAM, designed in 2001.
I designed the hardware and firmware for this synthesizer in 2001. Assembly language looks ancient now, but it was our standard practice for new hardware on Atmel micros, with a mature code library and toolchain behind it. We used C for other projects, but with 8 kB of flash and 256 bytes of RAM, assembly earned its keep.
Why assembly
- Precise hardware control. Registers, I/O ports, and memory addresses are manipulated directly, which is what device drivers, bootloaders, and microcontroller firmware need.
- Speed. Hand-optimized routines run faster and smaller than a C compiler's output, which matters in interrupt service routines and anything time-critical.
- Deterministic behavior. Every instruction has a predictable cycle cost. There are no compiler optimizations or hidden abstractions to surprise you in a real-time system.
- Size. With a few kilobytes of flash, assembly avoids the overhead of C's function and library conventions.
Hardware

- Tunes 1–255, selectable locally or over the serial link
- Four output channels with independent local volume control
- Remote tune selection and volume control over RS-485
- Numeric display of the current tune number
- In-circuit reprogramming
The schematic was drawn in Protel (later Altium). One page is below; the full PDF and all the source are in the GitHub repo, which exists for sharing. The project predates GitHub, so it isn't a development repo.

Getting decent audio from an 8-bit micro
The micro can only toggle a pin, so what comes out is a square wave. The hardware turns it into something you'd want to hear with a multi-stage passive RC low-pass filter.
The reason that works is Fourier. A square wave of frequency f is the sum of an infinite series of odd harmonics:
square(t) = (4/π) · [ sin(2πft) + ⅓ sin(2π·3ft) + ⅕ sin(2π·5ft) + … ]
The fundamental is a sine wave at f; the 3rd harmonic is a sine at 3f scaled by ⅓, the 5th at 5f scaled by ⅕, and so on. Even harmonics cancel in a symmetric square wave. Run it the other way and you can extract the fundamental sinusoid from a square wave by filtering out the harmonics, which is exactly what the RC stages do.

The RC filter stages 
Fundamental plus odd harmonics approaching a square wave 
The same series in Desmos 
Micro output above, filtered output below
Firmware
We had a solid assembly library for serial communication and 7-segment displays. The audio code is original. The micro produces a square wave at the desired note frequency and the filter above does the rest.
A tune is a count of notes followed by a (value, duration) pair for each note:

The output toggles on a timer overflow. Timer 2 is a 16-bit up-counter that runs from a preload value to 0xFFFF, overflows, and restarts, so the number of counts per overflow is 65536 − preload. The timer ticks at the 11.0592 MHz oscillator divided by 12, or 921,600 Hz, so one count is about 1.085 µs.
For a preload of 0xEFBF (61,375), that's 4,161 counts, roughly 4.5 ms per overflow. Each overflow toggles the output, so that's half a period: the full period is about 9 ms and the note is about 110 Hz, an A2. Working backwards from the frequency of each note gives the preload table for four octaves of twelve notes:

The entire source is in the repo.