Introduction: Cute Little ATtiny Programmer !

About: my inventions

An Attiny microcontroller is a great alternative to the Arduino UNO and other (larger) versions, for those projects that need fewer GPIO pins and need to be portable. But the ATtiny cannot be plugged straight into an Arduino board and be programmed. Another way would be to use an additional breadboard with many wires and an Arduino UNO as a programmer, but it would be really messy and it would be hard to program ATtiny's this way multiple times.

A better way would be to program it on an add-on shield. In my instructable I'm going to show you how to build an ATtiny programming shield based on an official proto shield R3 from Arduino. It is easy to build and looks nice with it's shiny blue & silver proto shield. It plugs neatly on to an Arduino UNO to program ATtiny's type 25/45/85 and 24/44/84. So all you have to do is plug the ATtiny on the IC holder of this shield and you can program it !

I also added a step-by-step description how to set up your Arduino IDE and start the programming sequence.

And finally how to reset your Arduino and the IDE to their original settings if you want to use the Arduino also for other projects after programming an ATtiny.

Supplies

Components:

1 Arduino UNO R3

1 Arduino official proto shield R3

32 straight through hole pin headers for Arduino

1 14 pin dip IC holder for ATtiny 24/44//84

1 8 pins dip IC holder for ATtiny 25/45/85

1 capacitor 10 uF 16V radial

1 pcb NO tactile switch 6x6 mm. (optional)

4 leds (blue, green, red and yellow)

4 resistors 680 Ohm 0.25 W

. insulated single core mounting wire 0.2 sqmm

. ATtiny for programming type 24/44/84 or 25/45/85


Tools:

. small soldering iron

. small wire cutter

. small plyer

. magnefying glass and led headlight (when needed)

. ohmmeter or circuit wiring tester and 5VDC power supply (battery?) for final test after soldering only

. lots and lots of patience

Step 1: Assembly

The programmer needs only a few components. Mount these components on the Arduino proto shield and solder the wiring according to the attached diagram. Use wiring without insulation for the red connections and wiring with insulation for the green connections, the latter cross the blank wiring. It was a real challenging puzzle to design the right setup for the components and the interconnections between them. Carefully select the holes in the Arduino proto board, there are a few hidden interconnections for GND, VCC and RESET integrated inside this board as shown in the picture. First mount the components and when this is done finally solder the pin connectors on the proto board. I used all 32 pins for a more stable connection between the board and the Arduino UNO.

After assembly you can check the connections with an ohmmeter or a circuit wiring tester to check for short-circuits or wrong connections. Do NOT connect the programmer board to an Arduino R3 during testing.

On the 2x7 Pin IC holder (ATtiny84):

Arduino 5V to ATtiny84 Pin 1

Arduino Pin 10 to ATtiny84 Pin 4

Arduino Pin 11 to ATtiny84 Pin 7

Arduino Pin 12 to ATtiny84 Pin 8

Arduino Pin 13 to ATtiny84 Pin 9

Arduino GND to ATtiny84 Pin 14


On the 2x4 Pin IC holder (ATtiny 85):

Arduino 5V to ATtiny85 Pin 8

Arduino Pin 10 to ATtiny85 Pin 1

Arduino Pin 11 to ATtiny85 Pin 5

Arduino Pin 12 to ATtiny85 Pin 6

Arduino Pin 13 to ATtiny85 Pin 7

Arduino GND to ATtiny85 Pin 4

The led's anode wires are connected to the digital pin connections.

(yellow on D7, red on D8, blue on D9, green on 5V)

all led cathodes are connected to GND via a 680 Ohm resistor.

To test all leds connect a 5VDC voltage (from a battery or a tester): (-) on GND and (+) on D7 or D8 or D9 or 5V. Then the connected led should light up.

The capacitor is connected between GND and RESET with the + connected to RESET.

The RESET button in the left top corner is optional.




Step 2: IDE Setup and Programming an ATtiny

This is my updated setup & programming description, based on the publication from CrtSuznik on www.instructables.com.

Important:

Do not connect the programming shield yet, The 10 uF capacitor between GND and RESET will block the upload of the ArduinoISP programmer sketch as described below.

The first thing you need to do is open up the Arduino IDE. Then go to File->Preferences.

In the "Additional Boards Manager URLs:" paste this:

https://raw.githubusercontent.com/damellis/attiny/...

and click OK.

Next go to Tools->Boards->Boards Manager (at the very top of the list).

In "Filter your search..." type attiny. It should only find one selection. Click on it and hit Install. Once it's done installing, close the IDE so everything resets.

These two additions on the Arduino IDE only have to be done once. They will be stored inside your IDE until you reinstall the IDE.

Congratulations! You have just finished the hard part, but you still need to prepare your UNO to program the Attiny.

To program the Attiny, you have to always first upload a special sketch to the UNO. You can find this sketch in:

File->Examples->ArduinoISP->ArduinoISP.

Once that opens up, go to Tools->Boards and select your UNO and its port number. Upload the sketch to your UNO as you normally would.

Once that's done, your UNO has transformed into a programmer for the Attiny !

Go ahead and plug in the shield you've made in the previous steps, being careful to connect the correct pins and putting the Attiny in the right way!

The green power led should light up, showing the proto shield is powered up.

The blue heartbeat led should flash constantly, showing the correct working of the programmer software.

Now on to actually uploading a program to the Attiny as follows:

Close the IDE.

Open up the IDE again (hit File and click New) and go to Tools->Boards.

If you scroll down, there you will find that you can now select the Attiny25/45/85 or ATtiny 24/44/84 as a board.

Go ahead and select your Attiny option and now go back to Tools and in "Processor:" select which ever Attiny you intend to use.

You also need to change the "Programmer" option in Tools to: Arduino as ISP. (not ArduinoISP, be careful !).

Load the code you want to program into the Attiny in your IDE now.

Once that's done, you should be able to upload this code to the Attiny the same way as you would upload to a regular Arduino. During the upload the yellow led should flash, showing the upload progress.

If something goes wrong, the red error led will light up.

Remove the Attiny from the programmer board to use it in your new project.

Now you can reset your Arduino and the IDE to their original settings, if you want to use the Arduino also for other projects after programming an ATtiny.

Remove the programmer board from the Arduino UNO.

Go to Tools->Boards and select your UNO and its port number.

Go to Tools->Programmer and select AVRISP mkII.

Reset the UNO with the reset button.

Now check your UNO by uploading a standard sketch.

For example File->Examples-> 01.Basics->Blink


In the attached pictures you can see which analog and digital pins you can use for the various ATtiny microprocessors.

Note that the pin numbers used in your uploaded new sketch in your ATtiny differ from the chip hardware pin numbers. For example on the ATtiny 85 the hardware pin 3 is the Arduino digital pin 4.

Happy programming, there are a zillion project examples with ATtinys on the internet !