After buying some ATtiny402 microcontrollers I've noticed that newer AVR models from Microchip are now using the UPDI interface for programming. Previously the programming was done using SPI or UART if a bootloader was present.
Contents
- What is UPDI and how do I use it?
- Can i manually reset the microcontroller when UPDI is shared with RESET?
- What hardware do i need for programming using UPDI interface?
- How to use a regular serial adapter module with UPDI
- What software do I need?
- Programming an UPDI device using avrdude, Microchip Studio and a USB to serial module
- Bonus tips
- Configuring pins on UPDI microcontrollers
What is UPDI and how do I use it?
UPDI stands for Unified Program and Debug Interface and is
proprietary to Microchip. In many ways is similar to 1 wire UART. The
main advantage is that it can be used for programming and also for debugging.
Now there is no need for SPI, bootloader, debugWire... It's all Unified in one
pin and one interface.
On certain devices such as ATtiny, the UPDI and Reset are on the same pin. In each case, the UPDI pin can also be used as a GPIO pin. When UPDI and Reset share the same pin, the functionality can be selected using the specific fuse. By default the fuse is set to select UPDI as a pin function. If you change the fuse and enable the Reset then you will need a 12V programmer to be able to program the microcontroller.
To prevent false triggering when the line is idle, it is recommended to have a pull-up resistor of at least 10k on the UPDI pin. Although some say that it works without problems even without a pull-up resistor so if you are using the UPDI pin also as a GPIO pin, you might consider not placing the resistor.
Source: https://microchip.my.site.com/s/article/AVR---Hardware-Design-Considerations-for-UPDI-pin.