I have made a short step by step guide for burning a bootloader into the ATtiny3217.
The ATtiny3217 is a very cheap and small Arduino compatible processor with 21 I/O lines. I have made a small development board: ATtiny3217 development board.
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
- FTDI adapter
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
Step 2
Connect 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".
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 combined FTDI / UPDI program connector is used:
Step 4
Testing if the UPDI programmer works properly.
- Open the sketch ATtiny3217-blinking-LED, see below
- Tools -> Board = Attiny3217 (without optiboot!)
- Tools -> Programmer = jtag2updi (megaTinyCore)
- Select Tools -> Port
- Upload the sketch and check if the LED is blinking
The LED 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); }