You are on page 1of 7

Food

Living

Outside

Play

Technology

Workshop

Program an ATtiny with Arduino


by randofo on September 26, 2011

Table of Contents
Program an ATtiny with Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Intro: Program an ATtiny with Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 1: Go get stuff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 2: Wire the circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 3: Program the Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 4: Filter cap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 5: ATtiny core files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 6: Program the ATtiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 7: Test circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

http://www.instructables.com/id/Program-an-ATtiny-with-Arduino/

Author:randofo

Randy Sarafan loves you!


I am the author of the book '62 Projects to Make with a Dead Computer' and Community Manager here at Instructables. I'm always sharing tons of awesome
projects. Subscribing to me = fun and excitement!

Intro: Program an ATtiny with Arduino


Follows are directions for programming the ATtiny microcontrollers using the Arduino IDE. In plain English, this is how to program 8-pin Atmel chips as you would
normally an Arduino. This is cool because the ATtiny is tiny, and - well - this allows you to make tiny things that don't need a big ol' microcontroller.
The instructions I have posted here are pretty much the same as instructions given by the incredibly awesome High-Low Tech Tutorial. I posted my version of the
instructions here because I plan to make a couple of upcoming projects using ATtiny chips and figured I would show my process.

Step 1: Go get stuff


You will need:
- Arduino
- Breadboard
- ATtiny85 (or ATtiny45)
- 10uF 16V electrolytic capacitor
- 220ohm 1/4 watt resistor
- LED
- solid core hookup wire

http://www.instructables.com/id/Program-an-ATtiny-with-Arduino/

Step 2: Wire the circuit


Connect the Arduino to the ATtiny as follows:
Arduino +5V
---> ATtiny Pin 8
Arduino Ground ---> ATtiny Pin 4
Arduino Pin 10 ---> ATtiny Pin 1
Arduino Pin 11 ---> ATtiny Pin 5
Arduino Pin 12 ---> ATtiny Pin 6
Arduino Pin 13 ---> ATtiny Pin 7

http://www.instructables.com/id/Program-an-ATtiny-with-Arduino/

Step 3: Program the Arduino


Select the "ArduinoISP" sketch from the "Examples" menu.
Upload the sketch to your Arduino as you would any other sketch.
Your Arduino is now configured as a serial programmer that can program other chips.

http://www.instructables.com/id/Program-an-ATtiny-with-Arduino/

Step 4: Filter cap


Put the 10uF capacitor between ground and the Arduino reset pin. Make sure to keep an eye on the capacitors polarity (ground to ground!).
It is rumored you only need this for the Arduino Uno, but I have found it helped matters to include it with earlier versions as well. If you find that it is not working in the next
steps, simple remove it and see if that helps.

Step 5: ATtiny core files


Take note of your sketchbook folder from the Arduino preference menu.
Create a new folder in your sketchbook folder called "hardware"
Then, go to this page and download the file: attiny45_85.zip
Unzip this file and leave it in the new hardware folder.
Finally, restart the Arduino programming environment. The new cores should now be loaded.
Note that there are also core files for a number of other ATtiny chips. This page is a good starting point for interfacing with a wide range of them using the Arduino.

http://www.instructables.com/id/Program-an-ATtiny-with-Arduino/

Step 6: Program the ATtiny


Select from the top menu:
Tools --> Board --> ATtiny85 (w/ Arduino as ISP)
(Of course, you will want to select a different chip for this if you are using one.)
Then open the basic blink example and change the pin number from 13 to 0.
Finally, upload it as you would any other sketch.
It should give the following error twice:
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
Simply ignore the error message and you should be good to go.

Step 7: Test circuit


Connect a 220 ohm resistor to pin 5.
Connect an LED between the resistor and +5V.
It should blink.
Congratulations. You're done.

http://www.instructables.com/id/Program-an-ATtiny-with-Arduino/

Related Instructables

Hacking an
Arduino ISP
Shield for
AtTiny45 /
AtTiny85 by
rleyland

Turn Your
Arduino Into an
ISP by mr_mac3

TinyDice LED
die (Arduino
compatible)
(Photos) by
emihackr97

Repair dead
AVR's - Attiny
fusebit doctor
(HVSP) by
manekinen

http://www.instructables.com/id/Program-an-ATtiny-with-Arduino/

New
Jar of Fireflies
by kjordahl

Apple-style LED
pulsing using a
$1.30 MCU by
hardwarehank

You might also like