This tutorial shows you how to wire up an Arduino used as an ISP (programmer) to an ATtiny45 or ATtiny85. To find out how to write code for the microcontroller, see the the tutorial on programming an ATtiny using the Arduino 1.0.1 software (or the older version for Arduino 0022).
Materials and Tools
For this tutorial, you’ll need:
- Arduino Uno or Duemilanove (w/ an ATmega328, not an older board with an ATmega168)
- ATtiny45 or ATtiny85 (8-pin DIP package)
- a 10 uF capacitor (e.g. from Sparkfun or from Digi-Key)
- a breadboard
- jumper wires
Download and Install the Arduino Software
Turning the Arduino board into a programmer
We’re going to use the Arduino board to program the ATtiny. First, we’ll need to turn the Arduino board into an “in-system programmer” (ISP). To this:
- Run the Arduino development environment.
- Open the ArduinoISP sketch from the examples menu.
- Note for Arduino 1.0: you need to make a small change to the ArduinoISP sketch before uploading it. Find the line in the heartbeat() function that says “delay(40);” and change it to “delay(20);”.
- Select the board and serial port that correspond to your Arduino board.
- Upload the ArduinoISP sketch.
Connecting the Arduino board and the ATtiny
We’ll connect the Arduino board to the ATtiny as shown in the following diagram. Use the dot in the corner of the ATtiny to orient it properly. We’ll also connect a 10 uF capacitor between reset and ground on the Arduino board as shown in the diagram (the stripe on the capacitor that’s marked with a negative sign (-) should go to ground). The capacitor prevents the Arduino board from resetting (which starts the bootloader), thus ensuring that the Arduino IDE talks to the ArduinoISP (not the bootloader) during the upload of sketches. (The capacitor is needed if you’re using an Arduino Uno, and might also be necessary for an Arduino Duemilanove.)
- ATtiny Pin 2 to Arduino Pin 13 (or SCK of another programmer)
- ATtiny Pin 1 to Arduino Pin 12 (or MISO of another programmer)
- ATtiny Pin 0 to Arduino Pin 11 (or MOSI of another programmer)
- ATtiny Reset Pin to Arduino Pin 10 (or RESET of another programmer)