Want a bench clock source that can hit almost any frequency without keeping a drawer full of crystal oscillators? Here is the shopping list for David Johnson-Davies’ Digital Signal Generator, and it is refreshingly short: an AVR16EB28 microcontroller, a 4.194304 MHz crystal for accuracy, a small numeric keypad, a rotary encoder, a 128×32 OLED, and two output pins. That is genuinely the whole build — a handful of parts most electronics benches already have lying around.
What the build actually does
Once assembled, the device outputs crystal-accurate square waves anywhere from 2 Hz up to roughly 33.5 MHz, and it does so in tiny 2 Hz increments across that entire span. Punch an exact figure into the keypad, or spin the rotary encoder for quick fine adjustments, and the current frequency shows up on the little OLED. Two output pins carry complementary square waves, so you can feed a precise clock to whatever you are bringing up — a fresh FPGA design, a vintage CPU, a counter, or a stack of logic chips.
The trick: NCO mode
Instead of dividing a master clock by whole numbers, which only lets you land on a limited set of frequencies, the project leans on the Numerically Controlled Oscillator mode built into the timer/counter peripheral of Microchip’s AVR EB-series chips. A phase-locked loop multiplies the 4.194304 MHz crystal first, then feeds the NCO, which steps evenly across the whole range so you can dial in an exact output rather than settling for the closest available option. There is a small amount of timing jitter at certain frequencies, but the average output stays highly accurate — and that jitter becomes proportionally smaller as the frequency climbs.
For any ECE student or school lab that regularly probes digital circuits, this is a satisfying build that quietly replaces a whole box of single-frequency parts. It leans on one clever peripheral most people never touch, which makes it a great excuse to actually crack open the AVR EB datasheet and see what that timer/counter can really do. Build one, and your next breadboard bring-up gets a lot less fiddly.
Frequently Asked Questions
What frequency range does this signal generator cover?
It produces crystal-accurate square waves from 2 Hz up to about 33.5 MHz, adjustable in tiny 2 Hz increments across the whole range.
What parts do I need to build it?
An AVR16EB28 microcontroller, a 4.194304 MHz crystal, a numeric keypad, a rotary encoder, a 128×32 OLED, and two output pins — most of which are common bench components.
What will I learn if I build this?
You’ll get hands-on with the AVR EB-series NCO peripheral and PLL clocking, understand how numerically controlled oscillators generate precise frequencies, and practice wiring a keypad, rotary encoder, and OLED into a single embedded interface.
