Home > Projects > Arduino Programmer Projects > Using the Arduino Uno to program ATTINY84-20PU

Using the Arduino Uno to program ATTINY84-20PU

Summary of Using the Arduino Uno to program ATTINY84-20PU


This article guides users on programming the ATtiny84-20PU microcontroller using an Arduino Uno as an In-System Programmer (ISP). It details configuring the Arduino IDE with the Arduino-Tiny library, uploading the ArduinoISP sketch to the Uno, and modifying a standard Blink sketch to target the specific pinout of the ATtiny84.

Parts used in the Programming ATTINY84-20PU Project:

  • Arduino Uno
  • ATtiny84-20PU processor
  • Atmega328P chip (optional pre-programmed replacement)
  • Arduino IDE software
  • Arduino-Tiny archive
  • Blink sketch

Using the Arduino Uno to program ATTINY84-20PU (Newark item # 68T3783). This Instructable shows how to use the Arduino platform to work with physically smaller processors, such as the ATtiny84 (84/44/24), ATtiny85 (85/45/25), and ATtiny2313. This example is specifically for the ATtiny84-20PU processor (Newark item # 68T3783) but can be adapted for the others boards by selecting the appropriate board from the Arduino software (i.e., Arduino IDE) and modifying the pinouts as required.

Using the Arduino Uno to program ATTINY84-20PU

Step 1: Configure the Arduino IDE Software

1) Ensure the Arduino IDE is NOT running.

2) Create new folder named “tiny” in your Arduino “hardware” folder
C:\Projects\Arduino\hardware\tiny

3) Download the Arduino-Tiny archive (ZIP-file)
http://code.google.com/p/arduino-tiny/downloads/detail?name=arduino-tiny-0100-0016.zip

4) Copy and paste the contents of the ZIP-file into the “tiny” folder.

5) Create a new file named “boards.txt” in the tiny directory.
C:\Projects\Arduino\hardware\tiny\boards.txt

6) Open the “boards.txt” file and the “Prospective Boards.txt” file using a text editor.

7) Copy board entries of interest from “Prospective Boards.txt” to “boards.txt”. I simply copied the entire contents from “Prospective Boards.txt” to “boards.txt”.

8) Save and close “boards.txt”.  Close “Prospective Boards.txt” (see picture for how the contents should look).

Step 2: Program the Arduino to Use as an In-System Programmer (ISP)

9 ) Open the Arduino IDE.

10) Select your Arduino board. I have the Arduino UNO  but replaced the processor with a pre-programmed Atmega328P chip from Adafruit, which requires that I select “Arduino Duemilanove with ATmega328.”

At this point, you should see additional “boards” listed, such as all of the ATtiny boards that as in your “Boards.txt”. Do not select the ATtiny chip at this point. Select your Arduino board so that you can tell the Arduino that you want to use it as an In-System Programmer (ISP).

11) Select AVR ISP programmer by selecting [Tools] [Programmer] AVR ISP.

12) Upload the ArduinoISP sketch to your Arduino by selecting [File] [Examples] ArduinoISP.

Using the Arduino Uno to program ATTINY84-20PU circuit

Step 3: Create Blink Sketch for the Attiny84

13) Open  sketch to be programmed onto Attiny84. This example uses the Blink sketch from the Arduino software.
[File] [Examples] [01.Basics] [Blink]

14) Edit the sketch so the LED pins correspond to the ATtiny84. That is, change “int led = 13;” to “int led = 0;

Major Components in Project
Arduino

For more detail: Using the Arduino Uno to program ATTINY84-20PU

Quick Solutions to Questions related to Programming ATTINY84-20PU:

  • How do I configure the Arduino IDE for ATtiny boards?
    Create a tiny folder in the hardware directory, extract the Arduino-Tiny archive into it, and copy board entries from Prospective Boards.txt to boards.txt.
  • Can I use this method for other ATtiny chips?
    Yes, the process can be adapted for other boards like ATtiny85 or ATtiny2313 by selecting the appropriate board in the IDE and modifying pinouts.
  • What is the best way to turn the Arduino Uno into a programmer?
    Select your Arduino board in the IDE, choose AVR ISP under Tools > Programmer, and upload the ArduinoISP sketch.
  • Which sketch should I use to test the ATtiny84?
    Use the Blink sketch found under File > Examples > 01.Basics > Blink.
  • How do I change the LED pin for the ATtiny84?
    Edit the sketch line int led = 13; to int led = 0; to match the ATtiny84 pinout.
  • Do I need to select the ATtiny board immediately?
    No, you must first select your actual Arduino board to upload the ArduinoISP sketch before switching to the ATtiny target.
  • Where should I download the Arduino-Tiny files?
    Download the ZIP file from the Google Code project page listed in Step 1.
  • What happens if I have a Duemilanove board?
    If you replaced the processor with a pre-programmed Atmega328P, you should select Arduino Duemilanove with ATmega328 in the board menu.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top