- program an attiny with arduino · pdf fileprogram an attiny with arduino ... by the...

16
http://www.instructables.com/id/Program-an-ATtiny-with-Arduino/ 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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Intro: Program an ATtiny with Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Step 1: Go get stuff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Step 2: Wire the circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Step 3: Program the Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Step 4: Filter cap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Step 5: ATtiny core files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Step 6: Program the ATtiny . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Step 7: Test circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Upload: ngokhuong

Post on 06-Mar-2018

233 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

Food      Living       Outside        Play        Technology       Workshop

Program an ATtiny with Arduinoby randofo on September 26, 2011

Table of Contents

Program an ATtiny with Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

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

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

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

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

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

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

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

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

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

Page 2: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

Author:randofo    Randy Sarafan loves you!My name is Randy and I run the Instructables Design Studio. I'm also the author of the books 'Simple Bots,' and '62 Projects to Make with a Dead Computer'.Since I am always making new things, subscribing to me = fun and excitement!

Intro:  Program an ATtiny with ArduinoFollows 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 wouldnormally 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 theinstructions 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 stuffYou will need:

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

Page 3: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

Step 2: Wire the circuitConnect the Arduino to the ATtiny as follows:

Arduino +5V ---> ATtiny Pin 8Arduino Ground ---> ATtiny Pin 4Arduino Pin 10 ---> ATtiny Pin 1Arduino Pin 11 ---> ATtiny Pin 5Arduino Pin 12 ---> ATtiny Pin 6Arduino Pin 13 ---> ATtiny Pin 7

Page 4: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

Step 3: Program the ArduinoSelect 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.

Page 5: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

Step 4: Filter capPut 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 nextsteps, simple remove it and see if that helps.

Step 5: ATtiny core filesTake 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.

Page 6: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

Step 6: Program the ATtinySelect 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 ATtiny85avrdude: 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 circuitConnect a 220 ohm resistor to pin 5.

Connect an LED between the resistor and +5V.

It should blink.

Congratulations. You're done.

Page 7: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

Related Instructables

ATTiny45/85LCD displaycontrol with ashift register,programmed inArduino bybaharini

Self-contained16-Digit display- Arduino &Attiny85 byPanici

ATtinyprogrammingwith Arduino bywirenut1980

Hacking anArduino ISPShield forAtTiny45 /AtTiny85 byrleyland

Chipper Board -ATtinyProgrammingShield byHammock Boy

Make your plantsmile bythanasisloi7

Page 8: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

Advertisements

Comments

50 comments Add Comment view all 153 comments

 Volthaus Electronics Laboratory says:  Jan 25, 2015. 2:36 PM  REPLYThanks for taking the time to put this up. Worked for me.

 samdevsung says:  Jan 22, 2015. 10:37 AM  REPLYcan i get the hardware files for atmega8 pls!

 samdevsung says:  Jan 22, 2015. 10:37 AM  REPLYcan i get the hardware files for atmega8 pls!

 samdevsung says:  Jan 22, 2015. 10:37 AM  REPLYcan i get the hardware files for atmega8 pls!

 samdevsung says:  Jan 22, 2015. 10:37 AM  REPLYcan i get the hardware files for atmega8 pls!

 gnuton says:  Jan 8, 2015. 8:53 AM  REPLYHere is the updated tutorial http://highlowtech.org/?p=1695and do not use the attiny45_85.zip listed in this page but the one you can find in the link I provided to you! cheers!

 infanati says:  Jun 6, 2013. 8:02 AM  REPLYI've been trying to program my ATtiny13V but I keep getting "'OUTPUT' was not declared in this scope".

// Must include for servos to work#include// Elements is the amount of numbers you want to dedicate to the running average// Increase the number for a slower reaction#define elements 5

// Variables for loopsint i = 0;int j = 0;

// The Analog Pins - C:Centre R:Right L:Left U:Upint pinC = 1;int pinR = 2;int pinL = 3;int pinU = 7;

// Variables to store the data from the photo-resisitorsint analogValueC;int analogValueL;int analogValueR;int analogValueU;

// The change in position from the last readingfloat posX = 0;float posY = 0;

Page 9: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

// The running average readings// - Each element is made up of the difference between opposite photorestorsint x[elements], y[elements];

// Servos - X is rotation/spin, Y is the tilt servoServo servoX;Servo servoY;

// Common servo setup valuesint minPulse = 600; // minimum servo position, us (microseconds)int maxPulse = 2400; // maximum servo position, us

void setup() {

// Turn on the pins, program doesn't work without it *shrug*pinMode(6, OUTPUT);pinMode(5, OUTPUT);digitalWrite(6, HIGH);digitalWrite(5, HIGH);delay (200);

// Attach each Servo object to a digital pwm pinservoY.attach(6, minPulse, maxPulse);servoX.attach(5, minPulse, maxPulse);delay(200);

// Sanity check!servoX.write(90);servoY.write(90);

// Start all the running average values to zerofor(i=0;i x[i] = 0;y[i] = 0;}

// Serial - good for troubleshootingSerial.begin(9600);delay(200);}

void loop() {

// This will help to balance the values so the sun tracker doesn't Jump around// during high contrast situationsint normal = (analogRead(pinC)/50);

// Read the photorestorsanalogValueC = (analogRead(pinC)/normal);analogValueL = (analogRead(pinL)/normal);analogValueR = (analogRead(pinR)/normal);analogValueU = (analogRead(pinU)/normal);analogValueD = (analogRead(pinD)/normal);

// Check if the Centre photorestor is the brightest, if it is then set the change to zeroif((analogValueC <= analogValueL)||(analogValueC <= analogValueR)){// Value is positive: go right, negative: go leftx[i] = analogValueR - analogValueL;} else {x[i] = 0;}if((analogValueC <= analogValueU)||(analogValueC <= analogValueD)){y[i] = analogValueU - analogValueD;} else {y[i] = 0;}

// The change in position is the average of all the elementsint totalX = 0;int totalY = 0;for(j=0;j totalX+=x[j];totalY+=y[j];}posX = totalX/elements;posY = totalY/elements;

// Send the values through the serial when it has gone through all the elementsif(i==0)avgDisplay();//if(i==0)rtDisplay();

// Change the position of the tracker towards the lightsimpleChangePos();

// Increment I through 0 to number of elementsi++;i = i%elements;delay(301);

Page 10: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

}

// Class will display a cross on the serial monitor showing real time values of the resistorsvoid rtDisplay(){Serial.print(" ");Serial.println(analogValueU);Serial.println(" /\\");Serial.print(analogValueL);Serial.print(" <= ");Serial.print(analogValueC);Serial.print(" => ");Serial.println(analogValueR);Serial.println(" \\/");Serial.print(" ");Serial.println(analogValueD);Serial.println();Serial.println();}

// Class will display the change in positionvoid avgDisplay(){Serial.print(" ");if(posY>0){Serial.println(posY);Serial.println(servoY.read());} else {Serial.println(" ");}Serial.println(" /\\");if(posX>0){Serial.print(posX);Serial.println(servoX.read());} else {Serial.print(" ");}Serial.print(" <= ");if((posX==0)&&(posY==0)){Serial.print("C");} else {Serial.print(" - ");}Serial.print(" => ");if(posX<0){Serial.println(-posX);Serial.println(servoX.read());} else {Serial.println(" ");}Serial.println(" \\/");Serial.print(" ");if(posY<0){Serial.println(-posY);Serial.println(servoY.read());} else {Serial.println(" ");}Serial.println();Serial.println();}

// Named so, because I am planning on making a more complicated versonvoid simpleChangePos(){// Variables to store the current position of the servosint readX = servoX.read();int readY = servoY.read();

// If there is a change:if(posX!=0){// If the servo is going to change position past its range of motionif((readX+posX)>180){if(readX!=180){servoX.write(180);}} else if((readX+posX)<0){if(readX!=0){servoX.write(0);}} else {// If the change is a non-zero and not past the servo's limit, change the positionservoX.write((readX+posX));

}delay(15);

Page 11: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

}

if(posY!=0){if((readY+posY)>180){if(readY!=180){servoY.write(180);}} else if((readY+posY)<0){if(readY!=0){servoY.write(0);}} else {servoY.write((readY+posY));}delay(15);}

}

If anyone got any ideas how to solve it pls let me know : )

 InevitableCraftsLab says:  Dec 26, 2014. 8:01 AM  REPLYi know this is old, but cant run the servo library on the tiny.

there is a library called servo8bit.h thas written for the tiny

 randofo says:  Jun 9, 2013. 11:38 PM  REPLYNot all of the code that runs on the Arduino will run on the ATtinys. When you start including libraries, like the servo library, the likelihood of it workingdiminishes.

Can you program one to blink an LED? If so, the problem is probably with some of the commands you are calling (presumably the servo code). You willneed to figure out some alternative way of writing the code, or to modify the library to work with the chip.

 infanati says:  Jul 17, 2014. 7:44 AM  REPLYI got a new ATTiny85 and and i tried to get it to blink and im still getting the same error. 'OUTPUT' was not declared in this scope.

 masrodjie says:  Jul 20, 2014. 2:42 PM  REPLYYou need to declare OUTPUT or try to change OUTPUT with 0

 ironheartbj18 says:  Dec 24, 2014. 3:50 PM  REPLYmuch nicer to have a breadboard what I made it.

Page 12: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

 lavoslava says:  Dec 13, 2014. 4:45 PM  REPLYI try to connect (for the first time!) Arduino Yun with ATtiny45 and try Blink example. Which version of Arduino software should I download and ? Where I can getthe schematic - how to connect the jumperwires from Yun to breadboard? Thanks!

 Dr_Quark says:  Dec 13, 2014. 4:13 AM  REPLYI was initially interested in the concept of ATiny, but after looking at the program memory limit and the required discrete parts required to get an ATiny projectrunning, I don't see much advantage over using a Pro Mini (except if it replaces a lot of discrete gate logic). For example, including SoftwareSerial.h andDallasTemperature.h balloons code to about 6700 bytes, so even in a ATiny85, there's not much room left for user code. There are also limitations on thecode that an ATiny can run. Can someone comment or provide examples where the ATiny has a critical advantage over the Pro Mini?

 SvenH says:  Nov 28, 2014. 8:55 AM  REPLYdoes anyone know why it says this?

avrdude: stk500_getsync(): not in sync: resp=0x00

 christopherjohnliggins says:  Dec 9, 2014. 4:09 AM  REPLYI had this problem. My issue was that I hadn't uploaded the Ardunio ISP code in step 3

 christopherjohnliggins says:  Dec 9, 2014. 4:08 AM  REPLYAfter a few glitches (my mistakes :-/ ) got it working on an Arduino Mini :D - excellent tutorial

 ianyeo1994 says:  Oct 12, 2014. 6:08 PM  REPLYRunning on Arduino Uno with 1.0.5-r2 IDE

This shows in the errors. Do I have to use an earlier version? Or is it fixable?

Blink.ino:10:21: error: Arduino.h: No such file or directory

Blink.ino: In function 'void setup()':

Blink:17: error: 'OUTPUT' was not declared in this scope

Blink:17: error: 'pinMode' was not declared in this scope

Blink.ino: In function 'void loop()':

Blink:22: error: 'HIGH' was not declared in this scope

Page 13: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

Blink:22: error: 'digitalWrite' was not declared in this scope

Blink:23: error: 'delay' was not declared in this scope

Blink:24: error: 'LOW' was not declared in this scope

 ianyeo1994 says:  Oct 13, 2014. 6:20 PM  REPLYadding

#include <Arduino.h>

#include <WProgram.h>

made it have only one error now

avrdude: usbdev_open(): did not find any USB device "usb"

 Andrés EstebanP says:  Nov 25, 2014. 4:58 PM  REPLYgo to Arduino IDE : tools-->Programer-->>Arduino as ISP

i got same problem

 ianyeo1994 says:  Oct 14, 2014. 12:35 AM  REPLYAhh I had to select the programmer as well

 Erocker says:  Nov 10, 2014. 4:26 PM  REPLYI'm having the same problem :/

 ianyeo1994 says:  Nov 20, 2014. 6:13 PM  REPLYAdd these lines to your code

#include <Arduino.h>

#include <WProgram.h>

 hann7911 says:  Nov 14, 2014. 2:52 PM  REPLYHi, if i need two digital outputs and four analog I/Os, can ATTINY24 does the job? Do I follow the same instruction as Attiny 45?

 Akin Yildiz says:  Nov 6, 2014. 5:51 PM  REPLYwhat can this thing really do? sorry, i'm a total beginner. can it read an analog sensor and turn on a 3mm led according to the data read.? for example an ldrphotoresistor?

 jcullins0 says:  Oct 23, 2014. 10:44 AM  REPLYHow does the tiny45 work on 3.3v and 4mhz, anything to watch for?

 carl.frederick.39 says:  Oct 12, 2014. 1:20 PM  REPLYWhen I try to download the ATtiny master.zip it doesn't create a master.zip file, just a folder with some other files in it.

 davting says:  Oct 11, 2014. 11:29 PM  REPLYi find that i need to include the following headers to the blink sketch for it to compile.

#include <Arduino.h>#include <WProgram.h>

but I finally did it!!

 shinystuff says:  Sep 29, 2014. 6:04 AM  REPLYGreat tutorial, really helpful! I had only one problem with the pin-out of the ATtiny85 but I figured it out.

Page 14: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

 Raphango says:  Aug 26, 2014. 5:19 PM  REPLYRemember you must select "Arduino as ISP" on the bootloader options.

 jamestav says:  Aug 20, 2014. 8:02 PM  REPLYIf you are using an Arduino Mega the pin connections will be a little different. Check it out on my blog: http://jamestav.blogspot.com/2014/08/programming-attiny85-microchip-using.html

 ihart says:  Aug 5, 2014. 7:51 PM  REPLYThanks for posting this! It worked great with an Attiny45 and Arduino 1.5.7 I didn't use a capacitor and it was fine. I selected 8MHz Internal clock.

 joesinstructables says:  Jul 23, 2014. 5:10 PM  REPLYThanks for posting the tutorial, it will be useful for a lot of projects.

 doriancin says:  Jul 10, 2014. 4:15 PM  REPLYThis is a great tutorial!! I have just one question, can I use the EEPROM and WIRE libraries with the ATTINY45 the datasheet says it support the i2c protocol...

Page 15: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

 uelman8002 says:  May 11, 2014. 8:27 PM  REPLYmy question on "Select from the top menu:

Tools --> Board --> ATtiny85 (w/ Arduino as ISP)"

1. Why choose ATtiny85 as the "board" when it is the target chip?

2. Shoudn't it be the Arduino Uno itself as the board?

3. If the chip is possible as the board, why there's no option for Atmega328p in the IDE, setting Arduino as ISP programmer?

 origamiAirControl says:  Apr 14, 2014. 4:21 PM  REPLYhow do you unzip the file?

 Victor8o5 says:  May 7, 2014. 10:05 AM  REPLYWith a program like 7zip or Winrar, obviously.

 Armadillo99 says:  Apr 9, 2014. 5:37 AM  REPLYWill this work the same way with an arduino mega?

 hydronics says:  Feb 12, 2013. 9:45 PM  REPLYyep I get the same error.

 randofo says:  Feb 13, 2013. 1:10 PM  REPLYAre you using the Arduino 1 software? Try downloading an older version of the software - perhaps 5 or 6 versions back. The core files don't seem to playnicely with Arduino 1.

 hydronics says:  Feb 13, 2013. 5:49 PM  REPLYOk, thanks for the reply. IT WORKS, IT WORKS! I redid everything and it worked and I could not reproduce the error from yesterday, although....1) Each time you unplug the USB, when you re-connect the USB/Arduino back into your PC, FIRST remove the capacitor...2) once the computer recognizes the Arduino (2-seconds wait) then replace the capacitor.3) this was a problem once but then it didn't reoccur...kinda glitchy ;( maybe just my janky setup.

I'm running Windows, Duemilanove to ATTiny85. I got it to work on 1.03 and 1.01. THANKS for this lovely tutorial!! so many projects to do now...

Also, can anyone tell me why the SPI library does not work on Attiny?... I found some code on gethub to get around this but... Can anyone point meto a good reference material for programming that might answer these strange truths that I am oblivious to. My background is MechanicalEngineering and Arduino.

 randofo says:  Feb 13, 2013. 8:54 PM  REPLYDoes the library gives errors or just not work? It can be because the registers names are different... or the clock speed of the ATTiny is muchslower... or it is using interrupts which the ATTiny does not support... or a host of other reasons. I would have to really look at the library to know.

 Jamebonds1 says:  Mar 5, 2014. 10:41 PM  REPLYIt depend. Only if you find right ATTiny driver file. Mine work fastest. Be careful to not get wrong hardware file or it will cause 1000 delay from onesec to 10 sec.

 Crash Plague says:  May 2, 2013. 12:11 PM  REPLYDoes the ATtiny need to have the Arduino bootloader put on it? Or can any ATtiny straight from digikey be put into this tutorial?

 Jamebonds1 says:  Mar 5, 2014. 7:53 PM  REPLYEnjoying Electronics, Pseakins and Crash Plague. This ATTiny85 doens't need bootloader and you wasn't suppose to do that. Bootloader can damagesATTiny as I did. Don't need that Bootloader anyway. Plus, External is bad choose for beginner.

 FoamboardRC says:  May 8, 2013. 8:10 AM  REPLYYep.

Page 16: - Program an ATtiny with Arduino · PDF fileProgram an ATtiny with Arduino ... by the incredibly awesome High-Low Tech Tutorial . ... Electronics Laboratory says

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

 pseakins says:  Dec 20, 2013. 7:32 PM  REPLYYep what? It was a two part question. Yep the ATtiny DOES need to have an arduino bootloader, or yep any ATtiny from digikey can be used andtherefore does NOT need a bootloader.

So, does it need a bootloader yes or no?

 FoamboardRC says:  Dec 21, 2013. 10:39 AM  REPLYIt doesn't matter where you buy it from, digikey, sparkfun, ebay. . .

Just follow the steps in the i'ble and you'll be fine.

 FoamboardRC says:  Dec 21, 2013. 10:41 AM  REPLYYes, it needs a bootloader

 AT says:  Feb 23, 2013. 8:19 PM  REPLYThis looked like such a cool project. But I am running into an issue that I can't figure out. I get the error once and then it says:

avrdude: Yikes! Invalid device signature.Double check connections and try again, or use -F to overridethis check.

When I connect the LED, nothin. :-(

view all 153 comments