- connect Arduino to the PC.
- open Arduino IDE.
- open the ArduinoISP example file (File > Examples > ArduinoISP).
- note: if using Arduino Mega, modify the following lines from:
#define RESET 10
#define PIN_MOSI 11
#define PIN_MISO 12
#define PIN_SCK 13
to:
#define RESET 53
#define PIN_MOSI 51
#define PIN_MISO 50
#define PIN_SCK 52
- upload sketch.
- go to File > Preferences.
- in the Additional Boards Manager URLs, add:
http://drazzy.com/package_drazzy.com_index.json
- go to Tools > Board > Boards Manager.
- search and install
ATTinyCore
.
- connect according to the table below:
ATtiny85 pin | Arduino Uno pin | Arduino Mega pin |
---|---|---|
VCC | 5V | 5V |
GND | GND | GND |
RESET | 10 (SS) | 53 (SS) |
PIN 0 / MOSI | 11 (MOSI) | 51 (MOSI) |
PIN 1 / MISO | 12 (MISO) | 50 (MISO) |
PIN 2 / SCK | 13 (SCK) | 52 (SCK) |
- add a 10uF capacitor between RESET and GND on Arduino, to avoid auto-reset while uploading program to ATtiny85.
- go to Tools > Board.
- configure as follows:
Board: "AtTiny25/45/85"
Processor: "AtTiny85"
Clock: "Internal 1 MHz"
Programmer: "Arduino as ISP"
- burn bootloader (Tools > Burn bootloader)
- upload the following program:
int led = 0;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}
- remove all connections except for VCC and GND.
- add a LED between ATtiny pin 0 and GND.