Electronics and C++ education with an ATTiny13

When [Adam, HA8KDA] is not busy with his doctoral studies, he supervises a group of students interested in engineering. To teach them a wide range of topics, he set out to create an entertaining little integrated project as they watch and participate along the way. With this ATTiny13A project adorned with LEDs, [Adam] demonstrated schematic and PCB design, then taught the basics and intricacies of C++ – especially when it comes to building small-footprint software – and tied it all together in a real-world device that students could take home after the project. His course went far beyond the “Hello world” we usually expect, and some of us can only wish for a college experience like this.

He shares with us the PCB files and software, but also talks about the C++20 framework he developed for this ATTiny. The ATTiny13A is very cheap and also very limited – you get 1K of ROM and 64 bytes of RAM. This framework lets you put it to good use, providing the basics like GPIO hustle, but also things like low-power operation hooks, software PWM with optional support for multi-phase operation and EEPROM access. Students could write their own animations for this device, and it includes them in the repository too!

In educational projects, it’s beneficial to keep the code direct and clean, cruelty-free, and accessible to students. These are things you can only achieve when you truly understand the tools you are working with, which is the perfect position to teach them! [Adam] intends to show that C++ is more than suitable for low-resource devices, and tells us about the EEPROM class code he wrote – compiling in the same amount of instructions as an assembly implementation and consuming the same amount of RAM, while providing compile time security checks and syntax.

We’ve talked before about using C++ on microcontrollers, getting additional functionality at compile time without overhead, and this project illustrates the concept well. [Adam] asks all of us, and in particular our fellow C++ assistants, our opinion on the framework he designed. Could you do even more with this simple hardware – make the code more robust, cleaner, make it do more with limited resources?

What could you build with an ATTiny13, especially with such a framework? A flashy handheld hair clip, perhaps, or an RF-code remote-controlled plug. We also saw a small camera trigger for endurance races, a handheld flappy bird-like the console, and many more!

Sam D. Gomez