Go Down

Topic: arduino as an AVR isp programmer - atmega8515 (Read 4 times) previous topic - next topic

###OCT###

Hello everybody, nice to finally have a valid question that wasn't answered before (or at least I couldn't find using the search here).

So I need to upload .hex (NOT the bootloader) file to an atmega8515, cheaply, since it will probably be an one time only type of thing, ruling out the need to build devices such as usbasp, or buying other programmers.

I've read the tutorials here, but they are geared towards uploading the bootloader only.
arduino.cc/en/Tutorial/ArduinoToBreadboard

The diagrams shown here are specific about using the atmega168, and no explanation about what each pin connection is doing makes it very hard for me to adapt it to the 8515 pins.  
arduino.cc/en/Tutorial/ArduinoISP

I'm thinking I can do this using the ATmega328p with the Arduino bootloader on it and use an Arduino as an USB-to-serial convertor,
AVRdude, MegaISP, the 8515 itself and a breadboard or build a simple target board like:
evilmadscientist/avrtargetboards

Here are the problems/questions:

-cant find a description on what each pin on the arduino will do when is "avr-isp mode"

-the 8515 is in a 40 pin DIP package form, I could not find a good schematic/ plan on building a target board for it, or protoboard plans. most are for 28 DIP. Do I need a crystal oscillators for this?

-I managed to get the spec sheet for the 8515, but cant figure how to manage things on the arduino side. I'm confused  :o

any help will be much appreciated, here are the details of what I have and need to do:

-I need to connect  pins:
ISP connector                         ATMEGA8515 pin number
MOSI                                                       6
RST                                                         9
SCK                                                         8
MISO                                                       7
GND                                                        20
VDD                                                        40

So how do I go about this on the arduino? how do I set the connections from the arduino to the microcontroller? what should I run as software on the arduino for it to work with AVRdude?  Do I need other components besides the duemillanove, protoboard, wires? can I set fusebits with this? whew, I know its a heck of a lot of newbeesh questions, but I really appreciate your help.  
here is what I have to work with:
-arduino duemillanove
-protoboard, wires
-mac (osx 10.5)
-atmega8515

Cheers,
OCT




Osgeld

look for arduino pin mappings, that should clear up whats going where, and yes you will need to use avrdude, it will look something like

avrdude -c avrisp -p insert_part_name -P insert_com_port -b 19200 -U flash:w:filename.hex

itsgeektime

OCT, the pinout of the arduino is commented on de ArduinoISP code (on the arduino examples)

I'm trying to use my arduino as an AVR programmer too, but I have some problems, I have a board with an ATMEGA8 and I have successfully connected the arduino board to the ICSP head of my board, but I can't program it through avrdude (I'm a linux user). I have the following error

Code: [Select]
$ avrdude -c avrisp -P /dev/ttyUSB0 -p atmega8 -b 19200 -U flash:w:test.elf.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.12s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
        Double check connections and try again, or use -F to override
        this check.


avrdude done.  Thank you.



Googling I have found arduino ISP programmer can't handle the device signature, so I add a -F, but I'm still having errors when I try to upload the hex

Code: [Select]
$ avrdude -c avrisp -P /dev/ttyUSB0 -p atmega8 -b 19200 -F -U flash:w:test.elf.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.12s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA8 is 1E 93 07
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
        To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "test.elf.hex"
avrdude: input file test.elf.hex auto detected as Intel Hex
avrdude: writing flash (110 bytes):

Writing | ################################################## | 100% 0.20s

avrdude: 110 bytes of flash written
avrdude: verifying flash memory against test.elf.hex:
avrdude: load data flash data from input file test.elf.hex:
avrdude: input file test.elf.hex auto detected as Intel Hex
avrdude: input file test.elf.hex contains 110 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.22s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
        0x12 != 0x00
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK

avrdude done.  Thank you.



Looks like there is some modifications on my board, but the results have non-sense with the code uploaded (just high-low some pins)

getting out of the avrdude errors, is fine that "avrdude: input file test.elf.hex auto detected as Intel Hex"? or can it be a compilation error?

itsgeektime


leppie

Make sure you dont change any of the pins (10 - 13) on the Arduino side.

Go Up