In this post I will describe how to program on ATTiny with Arduino. In this exemple, I’m going to use a ATTiny 45. Anyway the process is the same for ATTiny 85.
Price: less than $30 (Amazon)
Price: around $2 (Amazon)
Load the Arduino ISP program to a classical arduino Uno.
open the ArduinoISP example
I’m going to use a Arduino Uno as programmer. Choose it from Board Menu
Also select the right serial port and then upload the code to the Arduino Uno.
Now your Arduino uno is ready to be used as a programmer.
Wire ATTiny45 to the Arduino Uno
10uF capacitor it used to prevent the Arduino Uno from resetting and ensures that the Arduino IDE talks to the ArduinoISP (and not the bootloader) during the upload of the sketches to the ATTiny.
Upload Blink test to the ATTiny
First of all, we need to install ATTiny support to Arduino:
- Download ATTiny librairies : https://github.com/damellis/attiny/archive/master.zip
- Unzip this file and copy paste the content you Arduino Sketckbook location in a subfolder called hardware.
- restart your arduino IDE
- look at Tools > board, you can know view ATTiny boards
Now, we are going to load the Blink test on ATTiny
Choose ATTiny 45 (1mhtz)
Load Blink example
Modify it to use the 3 (Pin 13 does not exist on ATTiny45)
Select you Arduino AS ISP to program your ATTiny
Let’s start to load this program. To see it work you have to add a led on ATtiny pin 3:
Enjoy looking at the blinking led.