Guide on Programming the ATtiny85 Using Arduino Uno

by lorry in Circuits > Electronics

1645 Views, 2 Favorites, 0 Comments

Guide on Programming the ATtiny85 Using Arduino Uno

How to Program the ATtiny85 With the Arduino Uno Board.png

In this instructional guide, we'll explore the process of utilizing an Arduino board as a programmer for the ATtiny85 microcontroller.

To achieve this, we'll employ an Arduino UNO board as an In-System Programmer (ISP) and an ATtiny85 micro-controller. The tutorial will leverage Codebender, an online Arduino Integrated Development Environment (IDE).

By following these steps, you'll be able to effortlessly program both the ATtiny45 and ATtiny85 micro-controllers. Let's dive in!

Supplies

Supplies.png

For this guide, gather the following components:

  • Arduino UNO
  • Breadboard
  • ATtiny85
  • 10 uF capacitor
  • Jumper wires

Introduction to ATtiny85

ATtiny85 pinout.png

As per Atmel's specifications:

The ATtiny85 is a high-performance, low-power 8-bit AVR RISC-based microcontroller. It integrates 8KB ISP flash memory, 512B EEPROM, 512-Byte SRAM, 6 general-purpose I/O lines, 32 general-purpose working registers, and various other features. Operating between 2.7-5.5 volts, it achieves a throughput of 20 MIPS at 20 MHz.

Datasheet: [Download Link]

ATtiny85 Pinout:

  • Pin 1: Reset
  • Pin 2: Digital Pin 3 / Analog Pin 3
  • Pin 3: Digital Pin 4 / Analog Pin 2
  • Pin 4: GND
  • Pin 5: Digital Pin 0 (PWM)
  • Pin 6: Digital Pin 1 (PWM)
  • Pin 7: Digital Pin 3 (PWM)
  • Pin 8: Vcc (2.7~5.5V)

Pin function: ATtiny85 Pin Description

Arduino UNO As ISP

Arduino UNO As an ISP.png

Here's the "Arduino ISP" code, embedded using Codebender!

Download the Codebender plugin and click on "Run on Arduino" to program your Arduino board with this sketch. Once completed, disconnect the Arduino USB cable from your computer.

Connecting Arduino Uno With ATtiny85

Arduino Uno With the ATtiny85 01.png
Arduino Uno With the ATtiny85 02.png

Refer to the breadboard circuit schematic in the image above for easy connections. Use the following pin mapping:

  • Pin 1 to Arduino Pin 10
  • Pin 4 to Arduino GND Pin
  • Pin 5 to Arduino Pin 11
  • Pin 6 to Arduino Pin 12
  • Pin 7 to Arduino Pin 13
  • Pin 8 to Arduino 5V Pin

Include a 10uF electrolytic capacitor between the Arduino Uno reset pin and ground.

Programming ATtiny85 With Codebender

Program the ATtiny85 With Codebender.png

Utilize Codebender to program the ATtiny85 microcontroller. Connect to your Codebender account and follow the steps outlined in the guide.

Create a new sketch to turn on an LED connected to digital pin 3 (pin 2 of ATtiny85) with a 220 Ohm resistor.

Final Steps

Arduino Tutorials.png

Once programming is complete, remove the "programming" wires from the Arduino Uno board. Power the setup with only the 5V and GND cables. Alternatively, use a rechargeable battery (3.7V) or an external power source (max 5V).

Congratulations! You've successfully completed this tutorial on programming the ATtiny85 microcontroller with the Arduino Uno board. Feel free to share your thoughts in the comments, and stay tuned for more tutorials by clicking the Follow button!