Omzlo's Guide Gets You Up and Running with Bare-Metal Programming on Microchip's ATtiny 0-Series
"With the right tools," says Omzlo, "bare-metal programming on the new tinyAVR MCUs is as simple as on its older AVR cousins."
Embedded specialist Omzlo has published a step-by-step guide to programming Microchip ATtiny/tinyAVR microcontrollers using little more than a text editor, a makefile, and a USB TTL serial adapter.
"Microchip offers all the tools necessary to program [its] newer 'tinyAVR [0-Series]' MCUs with their Windows-only IDE," the company writes by way of introduction to the project. "There are also 'Arduino cores' for some of these newer 'tinyAVR' MCUs that let you program them with the Arduino IDE. But again, if you like to write code for MCUs in 'bare-metal' style, with your favorite text editor, a makefile, and a C-compiler, there are few resources available online."
That's where Omzlo's guide comes in. The step-by-step tutorial walks through programming an ATtiny406 via a USB TTL serial cable with a 4.7kOhm resistor on the TX port to run a simple "blinky" program. To ease wiring, and prove the concept works, a small breadboard-compatible breakout board was designed with the microcontroller, an LED, a button, a USB port, and the necessary resistor, plus a 2.54mm header for the TTL serial adapter.
The guide then walks through using pyupdi, Microchip's avr-gcc compiler, and any text editor of your choice to write the blink program - working directly with the ports on the chip via a bare-metal approach, no special firmware required. The program is then compiled via makefile and uploaded to the microcontroller.
"With the right tools," the company concludes, "bare-metal programming on the new tinyAVR MCUs is as simple as on its older AVR cousins."
The full guide, and a link to the breakout board design, can be found on the Omzlo website.