Main Content

Baremetal programming on the TinyAVR 0 micro-controllers

Are you an 8-bit or a 32-bit programmer?

At OMZLO, we have been mainly focussing our development efforts on newer 32-bit Arm-Cortex chips (STM32 and SAMD), which typically offer more RAM, more speed, more peripherals, at a similar or lower price-point than older 8-bit MCUs. But 8-bit MCUs are far from dead. Microchip has notably released a new series of chips, collectively branded as the “tinyAVR 0-series”, which offer more modern peripherals than the older AVR chips at a very competitive price point. They seem like the perfect candidate for simple products that don’t need all the features and fine-tuning capabilities of the newer 32-bit MCUs. 8-bit MCUs are also substantially simpler to program, which translates into faster development time.

Thanks to the success of the Arduino UNO, there are tons of tutorials online that explain how to program 8-bit Atmega328 microcontrollers and their cousins like the Attiny85 using direct register access, without the Arduino language or any vendor IDE such as Atmel Studio. Just google “atmega328 blinky”. All you need is an AVR C-compiler, a text editor, avrdude, and an AVR programmer. Some resources even show how to also build the electronics needed to get a basic atmega328 running on a breadboard. However, it’s hard to find the same information for these newer “tinyAVR 0” chips.

Of course, Microchip offers all the tools necessary to program these newer “TinyAVR” MCUs with their windows-only IDE. 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 “baremetal” style, with your favorite text editor, a makefile, and a c-compiler, there are few resources available online.

In this blog post, we will describe how to program a blinky firmware on an Attiny406, from the ground up, using the simplest tools. Most of the things described here can be easily transposed to other TinyAVR MCUs. Our approach is generally guided toward macOS or Linux users, but should also be applicable in an MS-Windows environment with a few minor changes.”

Link to article