A hobbyist has built a compact square wave generator around a low-cost CH32V203 microcontroller, reaching up to 30 MHz.

Square waves are usually produced with clock generator chips based on phase-locked loops, but a microcontroller can also create one on its own. That is the approach taken by Alun Morris in his Mega Hurts frequency generator, a pocket-sized instrument powered over USB-C.
The device is built around the inexpensive CH32V203F6P6 microcontroller, mounted on a small development board and housed in a 3D printed case. An OLED display and a rotary encoder make up the user interface. The generator can output frequencies up to 30 MHz and lets the user adjust the duty cycle. The signal is produced by the chip's 16-bit timer running in PWM mode, and it leaves the unit through a BNC connector. Although it only produces square waves, it could still be a handy little instrument.
The build also stands out for its prototyping method. Instead of designing a custom PCB, the project uses dead-bug construction, soldering surface-mount parts directly in place. It is a reminder that a working project can often be finished by using the parts already on hand.
Source: Hackaday






