🛠️ Getting started with UPDI programmer

📘 Overview

Welcome to the user manual for the ATtiny3224 development board. This guide will walk you through the steps needed to get started with programming the ATtiny3224 Microcontroller.

Below are some of the components needed to successfully program the ATtiny3224 development board using Arduino IDE.

  1. MegaTinyCore

    1. It is an excellent library written by SpenceKonde that provides support for the tinyAVR microcontrollers (Which is a newer series of AVR) out of which for our specific application, we use the ATtiny series of microcontrollers (ATtiny 0, ATtiny 1 and ATtiny 2).

    2. Simplifies programming ATtiny microcontrollers using the familiar Arduino environment.

    3. By using MegaTinyCore, you can efficiently develop software for ATtiny microcontrollers without needing to delve into complexities of low-level programming.

  1. UPDI Programmer with Serial monitor feature: This tool is essential for programming the development board. The Serial monitor feature provides ability of monitoring serial output from the ATtiny microcontroller UART using the Arduino IDE.

⚙️ Setup

Image12

Image13

Fig.a

Fig.b

Purpose:

This is the setup for programming and monitoring a microcontroller (ATtiny 3224).

Components:

Connections:



Setting up the Arduino IDE for programming ATtiny3224

The USB Serial UPDI programmer is used to download the sketch to the development board.

Choose "SerialUPDI (230400 baud)" in the “Programmer” option under “Tools” menu of Arduino IDE.

Fig.c

Note:

At 3.3V the microcontroller frequency is limited to maximum of 8 – 10 Mhz. At 5v 20MHz operation is possible.



Setting up Arduino IDE on Linux (Ubuntu)

  1. Needed only once to setup Arduino IDE for programming ATtiny3224

  1. Install Arduino IDE 1.8.19 from Arduino website or respective distro/OS software center.

  2. Launch the Arduino IDE you shall get following pop-up as fig.1, click add. (to take effect logout from your user account login back to the user account, now it is good to go)

Fig.1


  1. Install library of “megaTinyCore” by Spence Konde on to Arduino IDE, to add use the URL “https://drazzy.com/package_drazzy.com_index.json” library in the Arduino additional library option present in

    “Files --> Preferences(Fig.2) --> Additional Boards Manager URLs (Fig.3)”



Fig.2

Fig.3


Note: In Ubuntu it has been observed that “brltty” package does not allow the UPDI’s USB to be attached to the machine, following error is observed in dmesg output.


Fig. 4


Use the following command to resolve and the UPDI will be attached to ‘/dev/ttyUSB0’

sudo apt remove brltty


  1. Now goto

     “Tool” --> Board --> Boards Manager and search for “megaTinyCore” (using 2.6.8 version)
    and click install.



Fig.6

Fig.7


  1. Now edit “platform.txt” file in folder location as

    /home/USER_NAME/.arduino15/packages/megaTinyCore/hardware/megaavr/2.6.8/
    (in linux) comment the following line
    “compiler.path={runtime.tools.avr-gcc.path}/bin/”
    and add below it following line

    “compiler.path={runtime.tools.avr-gcc-7.3.0-atmel3.6.1-azduino6.path}/bin/”
    as shown in Fig.8.



Fig.8


  1. Now goto

    “Tools” menu --> Boards --> megaTinyCore --> ATtiny3224


Fig.9

Now Arduino IDE is ready to program and monitor ATtiny3224 microcontroller.

💻 Usage

Usage

Steps below show the programming steps using Provenant systems UPDI programmer

Flow Diagram of the UPDI & Serial monitoring mode



1.Tx: Transmitter

2.Rx : Receiver

3.UPDI (Unified Program Debug Interface): Used to program when the jumper is ON.

🔄 Sample Sketch & Arduino IDE pin assignment

Sample Code: LED BLINKING

void setup() {
Serial.begin(115200); //initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
Serial.printf("LED ON\r\n");
delay(100); // wait for a fraction of second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off (LOW is the voltage level)
Serial.printf("LED OFF\r\n");
delay(1000); // wait for a second
}
    
    

Below is the Arduino Pin configuration with refrence ATtiny 3224 pinout

Arduino Pin Assignment

Arduino Pin ATtiny Pin Number Comments
02PA4
13PA5
24PA6
35PA7 [LED_BUILTIN]
46PB3 [Rx]
57PB2 [Tx]
68PB1
79PB0
811PA1
912PA2
1013PA3
1110PA0 [UPDI]



Image reference of Arduino IDE pin assignment for ATtiny 3224 14-pin microcontroller


❓ FAQ

Q: My board isn't responding.
A: Check power and UPDI pin connection.

⬆️ Back to Top