Electronics

Electronics

Πέμπτη 5 Μαρτίου 2015

How To Program Attiny Using Arduino Uno







I had some ATtiny45 around and I wanted to program them as easier I could. After a lot of reading and searching I found 2 marvellous articles, one in instructables.com by How to program attiny using arduino uno" and one by High-Low tech "Arduino board as ATtiny programmer". First of all I made the circuit which is very easy and can be easily done based on these schematics, (pictures are very specific!). What I did was a mix of these 2 articles! First of all below informations are for "ARDUINO 1.05 IDE" which I have installed in my pc, I know for newer versions you have to make a different approach but not very different from mine. Ok! After you made the board :
1) Download the ATtiny core files from : https://github.com/damellis/attiny/archive/ide-1.0.x.zip
2)Locate your Arduino sketchbook folder (you can find its location in the preferences dialog in the Arduino software)
3)Create a new sub-folder called “hardware” in the sketchbook folder, if it doesn’t exist already.
4)Copy the “attiny” folder (not the containing attiny-ide-1.6.x or attiny-1.0.x folder) from the unzipped ATtiny.zip to the “hardware” folder. You should end up with folder structure like Documents > Arduino > hardware > attiny > avr that contains the file boards.txt and another folder called variants. (For Arduino 1.0.x, the boards.txt and other files will be directly in the attiny folder, with no avr sub-folder.)
5)Restart the Arduino development environment.
6)You should see an ATtiny entry in the Tools > Board menu.
7)Open the ArduinoISP sketch from the examples menu.
8)Select the board and serial port that correspond to your Arduino board.
9)Upload the ArduinoISP sketch.
10)CONNECT YOUR BOARD-SHIELD TO YOUR ARDUINO BOARD (Till now you shouldn't have connected it).
11)Go To Tools>Programmer>Arduino as ISP
12)Select your ATtiny from the Tools>Board
13)Select the Blink Example and change this line "int led=13" to "int led=4"
14)Upload It (I got these 2 errors but nothing happened " avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny45
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny45")

We have programmed our led to blink from pin4, because if you see the schematic of the ATtiny pin order, that's where we connected our led.

You Are READY!


Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου