A slightly boring tool to accurately* generate square waves for test purposes.
*: Accuracy unverified. 😜
It's based on the Atmel Microchip ATMEGA328P, mostly because that's what's in my Arduino Uno.
The UART can, rather conveniently, also be accessed over the Arduino Uno's USB connection. Currently, it's only used for controlling either the frequency or the period of the square wave. It supports the following commands:
[f][New frequency][Newline]
[p][New period][Newline]
omitting the '[]', of course, and assuming that [Newline]
is either "\r"
or "\r\n"
(or, if you have no idea what those mean, the Enter/Return key on your keyboard).
Given that I'm using a 16-bit timer to generate the square wave, all conversions between period and frequency are integer approximations, so if it's inaccurate, sowwy.
None. I don't plan to do anything more with this. It was just a test tool I built for work because I needed a quick-and-dirty signal generator and don't have the money for the lab bench kind lol.
If you have Visual Studio Code, rejoice! 🙌🏾 ✨
This supports the AVR Helper extension directly, so just hit "Build" on that and you should have a nice, shiny .hex file in the bin/
folder that you can flash with avrdude or similar.
Alternatively, just invoke avr-gcc the way you would in your favourite toolchain.