
There are many ways to generate a square wave, and given the availability of phase-locked-loop-based clock generator chips, it’s easy enough to do so from a microcontroller. But the microcontroller can be persuaded to make a square wave on its own, and and this is what [Alun Morris] has done with his Mega Hurts frequency generator. It’s a pocket square wave signal generator, powered from a USB-C socket.
At its heart is the inexpensive CH32V203F6P6 microcontroller mounted on a small dev board in a 3D printed case. There’s an OLED display and a rotary encoder to provide a user interface. The maximum frequency achievable is 30 MHz, with variable duty cycle. The generation is achieved using the chip’s 16-bit timer operating as a PWM peripheral, and the output reaches the world through a BNC socket. We can see it could be a useful little instrument, even if it’s limited to square waves alone.
We quite like the very simple prototyping technique used here, dead-bugging SMD parts without the need for a custom PCB. IT proves that sometimes, just going ahead and making the thing with what you have is the way forward.
