Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Helpful Arduino-as-ISP Commands
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Helpful Arduino-as-ISP Commands

by nezb on Tue Nov 09, 2010 11:36 pm

Hello! I recently made myself a little AVR programmer very similar to the USBtinyISP and I wanted to share some information that I discovered during this project (and wrote on my blog) with the rest of the community here.

The total parts I used were a very nice protoboard, ATmega168 + DIP socket, one red LED + 10K resistor, a Prolific PL2303 USB-serial cable (cheaper than an FTDI and works just as well), and of course some header and wire. Software is the MegaISP program which I recompiled for use with the internal oscillator instead of Arduino's crystal.

After you wire up the chip using the same mapping as ArduinoISP (Arduino to ATmega168 mapping here), to program your fuse bytes first do:
Code: Select all | TOGGLE FULL SIZE
avrdude -v -v -patmega168 -cstk500v1 -P/dev/cu.usbserial-A600cnPP -b19200 -e -Ulfuse:w:0xE2:m -Uhfuse:w:0xD5:m -Uefuse:w:0xF8:m


You can figure out your own fuse bits if you use a calculator like this one I found linked in a LadyAda tutorial: http://www.engbedded.com/fusecalc/

Arduino’s “unlock” lock bits are
Code: Select all | TOGGLE FULL SIZE
-Ulock:w:0x3F:m
although you may or may not need them depending on how your chip is when you buy it.

Then, finally, to program the flash memory with your code do:
Code: Select all | TOGGLE FULL SIZE
avrdude -v -v -patmega168 -cstk500v1 -P/dev/cu.usbserial-A600cnPP -b19200 -e -Uflash:w:myprogram.hex


And now, a picture! (It will be fitted into an Altoids tin very soon :P )
img1.jpg
img1.jpg (376.12 KiB) Viewed 1465 times


So now I can program other AVRs using this project and some female jumper wires! It works just fine with AVRDUDE and only cost me about $10 worth of parts. Hopefully this helps someone else to do the same.
nezb
 

Re: Helpful Arduino-as-ISP Commands

by nezb on Tue Nov 09, 2010 11:37 pm

Also I just wanted to add that the ATmega168 is very much overkill. You can use a less powerful chip to do the same thing, I just wanted to use what I already had laying around.
nezb
 

Please be positive and constructive with your questions and comments.