Burning a bootloader into the ATtiny3217 via the UPDI / reset pin (2)
I have made a short step by step guide for burning a bootloader into the ATtiny3217.
The ATtiny3217 is a small Arduino compatible processor with 21 I/O lines that I use in the smallest Arduino board ever made: the Nano DIP.
MCUdude SerialUPDI programmer
The MCUdude SerialUPDI programmer is a programmer for use with any AVR that has a UPDI programming interface.
- UPDI for uploading the bootloader.
- UART with USB connector for easy serial debugging.
- Automatic UART / UPDI selection.
https://github.com/SpenceKonde/AVR-Guidance/blob/master/UPDI/jtag2updi.md
Read the article about the megaAVR ATtiny family
I want to thank Spence Konde for writing an extensive article about the megaAVR ATtiny, see GitHub.
Required
- ATtiny3217
- Arduino Nano
- 10uF capacitor
- 4.7k resistor
Step 1
Making an UPDI programmer with the Arduino Nano.
- Tools -> Board = Nano
- Tools -> Atmega328 (sometimes old bootloader)
- Upload the jtag2updi sketch to the Arduino Nano see GitHub (without the the 10uF connected!)
Step 2
Connect now the 10uF capacitor and 4.7k resistor, see the image here.
The UPDI programmer is now ready
Step 3
Installing the megaTinyCore package.
- File -> Preferences> Additional board manager URLs = http://drazzy.com/package_drazzy.com_index.json
- Tools -> Boards -> Boards Manager ...
- Select "megaTinyCore by Spence Konde" and click "Install". (This can take a while)
See here an Arduino Nano used as UPDI programmer. If you only use this Arduino Nano now as a UPDI programmer, you can skip the steps above the next time.
Here the Small program connector for the Arduino ATtiny3217 is used because there is no USB interface.
Step 4
Do this test: send the ATtiny3217-blinking-LED sketch to the ATtiny3217 board by using the UPDI programmer and the UPDI pin.
Connect the 3 pins (GND, 5V, UPDI) to the ATtiny3217 board.
- Open the sketch ATtiny3217-blinking-LED, see below
- Tools -> Board = Attiny3217 (not the w/Optiboot !)
- Chip -> ATtiny 3217
- Clock -> 16MHz internal
- UPDI/Reset Pin = UPDI (default)
- Programmer = SerialUPDI – SLOW:57600 baud
- Select Tools -> Port, select the right port
- Upload the sketch (as normal) and check if the LED is blinking
The LED on the ATtiny3217 board will continue to flash now.
Step 5
Burning the ATtiny3217 bootloader, after this, UPDI is not working anymore.
- Tools -> Board = ATtiny3217 (optiboot)
- Tools -> UPDI / reset pin = reset (Danger)
- Tools -> burn bootloader
The bootloader is now burned into the ATtiny3217.
Step 6
Testing if the bootloader works properly and if we can upload sketches via the serial pins RX and TX.
- Disconnect the UPDI programmer we made in step 1
- Connect an FTDI adapter between the PC and the ATtiny3217
- Tools -> Board = ATtiny 3217 (optiboot)
- Upload the ATtiny3217-blinking-LED sketch and check if the LED is blinking.
ATtiny3217-blinking-LED sketch
// File -> Preferences > Additional board manager URLs = http://drazzy.com/package_drazzy.com_index.json const byte ledPin = 3; void setup() { pinMode(ledPin, OUTPUT); } void loop() { digitalWrite(ledPin, 0); delay(500); digitalWrite(ledPin, 1); delay(500); }