Arduino and ATtiny45 / ATtiny85

We all love our Arduino's, but sometimes we just want to create a simple circuit and using an ATmega328 chip can be overkill or just plain too big. Well, did you know that you can use the Arduino IDE to program ATtiny45 and ATtiny85 8-pin chips?

Atmel ATtiny chip

Well you can, and this tutorial will show you how. We will program an ATtiny45/85 with the blink example sketch

Note: This tutorial uses Arduino 0.22. If you are using Arduino 1.0 you need to download a different attiny library. See this page for details (http://hlt.media.mit.edu/?p=1695)

We are going to use an Arduino UNO as the programmer by using the ArduinoISP sketch.

Firstly, you will need to add support for the ATtiny45/85 chips to your Arduino IDE.

  1. Download the file attiny45_85.zip
  2. Open up the zip file and copy the attiny_45_85 directory into your arduino-0022/hardware directory

Next, we need to load our Arduino UNO with the ArduinoISP sketch.

  1. Open the ArduinoISP sketch from the examples menu.
  2. Select the board and serial port that correspond to your Arduino board.
  3. Upload the ArduinoISP sketch.

Now we need to connect the Arduino board to the ATtiny as shown in the following diagram. Also connect an led and resistor between pin 5 and pin 4 (0V) observing correct polarity.

Attiny 85 wiring to Arduino

Once you have it all wired up, select the ATtiny45 (w/ Arduino as ISP) or ATtiny85 (w/ Arduino as ISP) board depending on the chip you are using

Arduino IDE select ATtiny board

 

Then load up the Example sketch blink.

As the ATtiny doesn't have a pin 13, change the pin number in the sketch from 13 to 0 in the 3 places it occurs and click on the Upload button

 

Arduino Blink Sketch

You will get the following message, but ignore it, the upload should have worked ok.

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85

Now the LED should be blinking.

SUCCESS!!

The following Arduino commands are supported by the ATtiny library you have installed:

Shopping Cart
0 items
 
DELIVERY/PAYMENT

Free Delivery Orders over £50

UK - £2.40 orders below
                    £50.00
EU Airmail from £3.95
Worldwide from £7.95
More Details...

 
Brands
 
 Check out our videos