ATTiny85 Programmer

The other project for this weekend was a really simple ATTiny85 programmer ‘shield’ for an Arduino Uno. This board fits on top of the Uno and effectively turns the Uno into a programmer for the ATTiny chip. The programmer takes about 20 minutes to assemble, and requires nothing more than a piece of stripboard, a dip socket and a 10μF capacitor. I have also added an LED (+ 220Ω resistor) to the board so that I can test the ATTiny by uploading a blink sketch.

Stripboard View

I have used a 9 x 25 stripboard (a standard size you can by cheap off ebay), as it was what I had to hand. Of course, you could use a dedicated Arduino proto shield, which would look a lot neater and fit better.

DSCN4465

Side views:

 

Fritzing View

Below are the Fritzing diagram for the programmer. On the left is the topside to show the placement of the components (note that the top of the stripboard has no strips on it – they are shown here for guidance only). The right view shows the reverse of the board, where the strips have been cut. I have a little tool for doing this, but a 4mm drill bit would work just as well.

ATTinyProgrammer_bb

Components

9 x 25 single-sided stripboard
8 pin DIL socket to fit the ATTiny
1 x 10μF capacitor
1 x 220Ω resistor
1 x 3mm LED
single core wire
1 x 9 pin male header, 1 x 7 pin male header
1 x ATTiny85 to program

Assembly

Start by soldering the resistor to the board, followed by the jumper wires. Then add the DIL socket.

Before soldering the headers, place the headers into the stripboard , and then onto the socket on the Arduino and push them into place. Using a flat metal object (such as the side of a pair of tweezers) press on top of the headers to push the pins down so that they are flush with the plastic body. This helps to extend the pins, so they fit better into the sockets on the Uno. Now go ahead and solder the headers onto the stripboard.

Add the LED – don’t forget to get this the right way round : the longer leg (anode) goes next to the resistor.  Finally add the capacitor.

When you have finished soldering the stripboard, fit it on top of the Uno, making sure that the right hand side pin of the 7 pin header fits into the right hand GND socket on the Uno, and the  right hand side pin of the 9 pin header fits into socket 8 of the Uno. See image above.

Below is an image of the programmer with teh ATTiny in place. Note the location of the dot. I have coloured this in white to highlight it, bt on the chip itself it will be black.

DSCN4467

Using the programmer

  1. Before you can program the ATTiny with the Arduino IDE, you will need to add ATTiny hardware profile to the Arduino IDE. With version 1.6.4 you can use the tools > boards > boards manager to add the ATTiny. With older version you will need to manually download and install the profile. I would suggest you go here, as this is a good explanation of how to set it up.
  2. Place the programmer onto the Uno as described above. Plug the Uno into your computer using the USB cable.
  3. Open the Arduino programming IDE and open the sketch Examples > ArduinoISP. Compile and upload this sketch to the Uno. This temporarily converts the Uno into a programmer for the ATTiny.
  4. Make sure your ATTiny85 is in the socket on the programmer, and that it is the right way around. See image above for correct orientation.
  5. Open the standard blink sketch and change it to the following:

 

[code language=”cpp”]

void setup() {
// put your setup code here, to run once:
pinMode(3, OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:
digitalWrite(3, HIGH);
delay(100);
digitalWrite(3, LOW);
delay(100);
}

[/code]

  1. Change the board type in the Arduino IDE to ATTiny85 (how to do this will depend upon which version IDE you have) and select 8MHz internal clock. The COM port will be the one that the Uno is connected to.
  2. Compile and then upload the ATTiny sketch. You should see the LED blinking.

 

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *