ATtiny Programming With Arduino

After this Instructable you should be able to program an A Ttiny85/45 with an arduino. It may sound complex but it really isn’t. After doing some research I could not find to much info on how this could be done. I however did find This Instructable is my interpretation of what I learned from Randy. 

Step 1: Things You Will Need

AT tiny 85/45 ‚Ästavailable from Mouser¬†¬†556-ATTINY85-20PU¬† Need more info on the AT tiny check out the data sheet¬†here.
Bread board ( or the 8 pin shield from Instructables )
Bread board jumper wires
Led- 5
330 ohm resistor-5
1uf 50V electrolytic capacitor

Step 2: Set Up

You will be using the following arduino pins (see pic)
5V +
5V Ground x2

Wire up the bread board with the jumper wires as follows or see pic:
Note: be sure to not the dimple direction.

ATtiny  pin# 1 to arduino pin# 10
ATtiny  pin# 4 to arduino 5v ground
ATtiny  pin# 5 to arduino pin# 11
ATtiny  pin# 6 to arduino pin# 12
ATtiny  pin# 7 to arduino pin# 13
ATtiny  pin# 8 to Arduino 5v +

Now lets move onto adding our leds. Add the leds to the bread board as see in the pic keeping in mind the polarity of the leds.
Add the resistors to the positive side ( side without the flat part ) each led with get a resistor. Take some jumper wires from the resistors and connect them to the following ATtiny pins.

ATtiny pin# 5 this will be programmed as pin 0 in the sketch
ATtiny pin# 6 this will be programmed as pin 1 in the sketch
ATtiny pin# 7 this will be programmed as pin 2 in the sketch
ATtiny pin# 2 this will be programmed as pin 3 in the sketch
ATtiny pin# 3 this will be programmed as pin 4 in the sketch

Step 3: Setting Up the Arduino to Program

Setting up the arduino to program is not a permanent thing. All this will do is load a sketch that will allow you to program the chip then when you want to use the arduino you simply change the sketch. 
Fist things first you will need the program, down load it by clicking  be sure that you are using arduino program version 0022.


Installing ATtiny45 / ATtiny85 support in Arduino

Locate your Arduino sketchbook folder (you can find its location in the preferences dialog in the Arduino software)
Create a new sub-folder called ‚Äúhardware‚ÄĚ in the sketchbook folder.
Copy the attiny45_85 folder from the to the hardware folder.
Restart the Arduino development environment.


Turning the Arduino board into a programmer

We‚Äôre going to use the Arduino board to program the ATtiny45 or ATtiny85. 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.
Select the board and serial port that correspond to your Arduino board.
Upload the ArduinoISP sketch.


Connect 1uf 50V electrolytic capacitor as follows:
 side with stripe to arduino ground
side with no stripe to arduino reset pin


In the arduino development environment click on tools, board and select ATtiny85 (w/ arduino as ISP ) be sure if using ATtiny 45 you select the correct one. Now you can write your sketch and upload it as you would normally to the arduino. While uploading a new sketch the leds will blink crazy for a sec then the program will take over and will run as programmed. 

Once the sketch is uploaded you can remove the electrolytic capacitor.

         Sometimes after you upload your sketch you may get the following errors:

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

Do not worry the sketch will have loaded just fine. You can now remove all but the 5V+ and ground wires you how successfully  programmed an ATtiny chip!

The following Arduino commands should be supported:


Step 4: The Sketch

This will blink all 5 leds

Step 5: Returning Arduino Back to Normal Operation

This is easy, 

Run the Arduino development environment go to tools, board then select the board you are using and load what ever sketch you would like. That’s it! 

Well I hope I have covered everything in as much but not overly confusing detail as possible. Feel free to contact me on any new updates regarding the programming and or sketches and I will add them.

Source: ATtiny Programming With Arduino

About The Author

Muhammad Bilal

I am a highly skilled and motivated individual with a Master's degree in Computer Science. I have extensive experience in technical writing and a deep understanding of SEO practices.

Leave a Comment

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

Scroll to Top