Goodbye Arduino: Switching to tinyAVR UPDI Programming
Replacing an old Arduino, nano, or other microcontroller with the new tinyAVR series can be an intimidating task. However, with the introduction of the Unified Program and Debug Interface (UPDI) from Microchip, the process has become much simpler. UPDI requires only one pin for programming, drastically reducing the complexity of the design.
Mega Tiny Core
The Mega Tiny Core is a great starting point for those looking to switch to tinyAVR. It provides access to the full range of pinouts for Arduinos, as well as a variety of other microcontrollers. To install the Mega Tiny Core, simply copy the URL and add it to the board manager URL in the Arduino IDE preferences. Once the board is installed, it will appear in the Tools > Boards menu.
Serial UPDI Adapter
To program the tinyAVR, the serial UPDI adapter must be selected as the programmer. Once this is done, the Arduino IDE will function as normal. The recommended method for programming is to use an FTDI adapter. This requires connecting ground to pin 14, VCC to 5V, and the TX and RX pins to 5V. The TX and RX pins should then be connected to the UPDI pin 10.
Diode and Resistor
To complete the connection, a diode and resistor are required. The diode should be connected from the TX pin to the RX pin, and a 470 ohm resistor should be connected from the diode to the UPDI pin. This is a much simpler solution than the older tinys, as the power supply is now located on the edge of the board, rather than diagonally opposite.
Debugging
Unfortunately, debugging via the UPDI pin is not possible. To access the serial printlines, the TX pin must be connected to the 7th pin. This is a quick and easy solution, but it does have its drawbacks.
Alternative Method
An alternative method is to use a nano board with the jtech 2 UPDI adapter. This requires connecting a 10F capacitor between ground and reset, as well as connecting 5V and ground. The TX pin should then be connected to the UPDI pin with a 470 ohm resistor. This method is not recommended, as it can cause bugs.
Switching to tinyAVR UPDI programming is a great way to simplify the design of a microcontroller board. With the introduction of the UPDI interface, programming is now much easier and faster. While there are some drawbacks to this method, it is still a great way to get started with tinyAVR programming.