Kamis, 02 Agustus 2012

Recently i was looking at Arduino Playground, There i saw this useful project called MegaISP. I downloaded it and tried and it worked really fine for me. I tried MegaISP to program an ATmega8l, ATmega8, ATmega16, ATmega32 and i believe, supports other MegaAVR’s too. I did not check it with TinyAVRs.However it is written at MegaISP project hosting that it support Tiny2313, Tiny13 etc.


This tutorial is about sharing the basic know how to build one MegaISP using your own Arduino/ Freeduino.
I had this Freeduino board with me and tried MegaISP on it, It worked just fine.

Let me show you, How ?

    1. Download the latest version of ArduinoISP Sketch  here.
    2. Extract the archive anywhere onto your Disk.
    3. Open the ArduinoISP.pde sketch (Inside the downloaded archive)
    4. Compile the ArduinoISP.pde sketch once to verify (OPTIONAL)
    5. Upload the sketch to your Freeduino/Arduino board. (assuming you know how to upload !)
    6. Now, its time to attach the target AVR device (e.g. m8, m32, t2313, t13 etc.) with your recently baked Arduino MegaISP.
    7. Make the following connections.

 

8. Now, Once connection as shown in table above are made. Open a command prompt window to copy your .hex file onto target device.
9.  MegaISP transfers the .hex file using avrdude.  So you need to have avrdude installed in your PC. (If you have WinAVR installed, avrdude is also installed by default).
10. To check if avrdude is installed or not ? Open a command prompt, type ‘avrdude’ (without quotes) and press enter, If you get a list of various options, that means avrdude is installed, otherwise you have to install it.
11. Now type following command to see if avrdude is able to recognize ArduioISP as avrISP.

avrdude -p m8 -P com13 -c avrisp -b 19200

com13 in above command is the Virtual com port made by FTDI chip on our Arduino/ Freeduino board, It will be different in your case, Goto DeviceManager->Com ports,  to check your number.

12. If you get output of above command something like shown in the image below, You have done everything correctly and you are almost there.
13. Now go to the directory where you have the .hex file, which you want to be copied onto target AVR device. Use ‘cd’ (Change Directory) command for that.
14. Once you are in the correct directory, type in the following command…

avrdude -p m8 -P com13 -c avrisp -b 19200 -U flash:w:main.hex

PS :
m8 in above command stands for ATmega8, yours can be different sat m328, t2313 etc
com13 can vary in your case, see device manager->com port for your Virtual com port
main.hex is the name of .hex file name i have generated, you can have any .hex file name here.
15. Hit enter and this should flash the hex file onto Target AVR device.
PS:

If it gives an error something like stk_500() out of sych blah blah blah…Just try once more, it worked in my case, If it does not work out in your case. Connect a 220E resistor between +5V and GND pin of Arduino/Freeduino. Still facing problem ? Just drop a comment below….


Source : electroons

0 komentar:

Posting Komentar