Offline
Newbie
Karma: 0
Posts: 26
|
 |
« on: February 20, 2012, 01:21:44 am » |
I'm new to the Arduino and just starting to play around with my Mega 2650r3, but one thing I wanted to try out was the ArduinoISP capability to flash an Atmega8515 for another project I'm working on. I have the Intel-format .hex file I wish to flash and I know the pinout for hooking it up, and I've have tried following the tutorial's I've found, but I have a feeling that I'm missing something in the configuration for flashing on a breadboard (preferably the barebones setup without additional components on the board). I can get as far as uploading ArduinoISP to the Mega and then firing up avrdude and initializing the chip, but when I try to flash the actual .hex, it gives me a protocol error. I'll post any more detailed information that may be necessary, but I'm pretty sure I am missing some basic setup, since most of the tutorials I've found are for programming other chips, so I may be incorrectly configured. Any pointers would be greatly appreciated. EDIT: For anyone reading this later for reference, I ended up wiring up the entire circuit shown here http://arduino.cc/en/Tutorial/ArduinoToBreadboard using an external crystal, the barebones layout did NOT work. I then had to follow this hack http://code.google.com/p/arduino/issues/detail?id=661#c3 to get ArduinoISP to play nice. Also, to clear up a couple of things that were not quite clear to me as a noob searching aimlessly on the internet, this does require a 100nF (.1uF) cap across RESET and GND on the Arduino inserted AFTER the ArduinoISP sketch has been uploaded but BEFORE uploading the .hex to the 8515, and the 22pF caps on the crystal recommended in the above linked guide worked fine even though my project manual indicated the need for 27's.
|
|
|
|
« Last Edit: March 14, 2012, 12:10:07 am by qwertymodo »
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 119
Posts: 10179
|
 |
« Reply #1 on: February 20, 2012, 01:40:01 am » |
it gives me a protocol error - ? -
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 26
|
 |
« Reply #2 on: February 20, 2012, 01:53:32 am » |
Sorry, I tried it last night and have since disconnected it. Didn't remember the exact error offhand. I'll hook it back up and post back.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 26
|
 |
« Reply #3 on: February 20, 2012, 02:26:41 am » |
If it happens to be relevant, using the project documentation I have, this is how it's all connected: MEGA || 8515 MISO 50 7 MOSI 51 6 SCK 52 8 SS 53 9 +5v 40 GND 20 And here's the output of avrdude: C:\>avrdude -p m8515 -P com7 -c avrisp -b 19200 -U flash:w:gbcf-fw-2.1-usb.hex
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATMEGA8515 avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.14s
avrdude: Device signature = 0x1e9306 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: please define PAGEL and BS2 signals in the configuration file for part ATMEGA8515 avrdude: reading input file "gbcf-fw-2.1-usb.hex" avrdude: input file gbcf-fw-2.1-usb.hex auto detected as Intel Hex avrdude: writing flash (3614 bytes):
Writing | | 0% 0.00s avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64 avrdude: stk500_cmd(): protocol error
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 119
Posts: 10179
|
 |
« Reply #4 on: February 20, 2012, 02:50:49 am » |
Using Arduino IDE 1.0?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 26
|
 |
« Reply #5 on: February 20, 2012, 02:59:47 am » |
I used Arduino IDE to flash the ArduinoISP sketch to the Arduino, then I used avrdude manually from the command-line because I couldn't find any way to program a specified .hex file to a specified microcontroller, only the presets for the Arduino controllers.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 119
Posts: 10179
|
 |
« Reply #6 on: February 20, 2012, 03:09:05 am » |
Which version of the Arduino IDE did you use to compile the ArduinoISP sketch?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 26
|
 |
« Reply #7 on: February 20, 2012, 03:19:49 am » |
Whatever the latest version was as of a week or so ago. It says 1.0. And I'm using the ArduinoISP sketch that came with it. File>Examples>ArduinoISP
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 119
Posts: 10179
|
 |
« Reply #8 on: February 20, 2012, 03:38:33 am » |
The failure is the result of a bug in the ArduinoISP sketch surfaced by a change in the Arduino IDE 1.0. You can either lower the baud rate to 9600 or send me a Personal Message with your email address and I'll reply with a version that works.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 26
|
 |
« Reply #9 on: February 20, 2012, 03:42:04 am » |
So, I did some more reading, and from what I've seen, I need to disable auto-reset? I read that a 120ohm resistor or 100nm cap bridging from +5v to reset should be sufficient. From what I have on hand, I have an equivalent resistance of ~114ohms across it and here's what I get now: C:\>avrdude -p m8515 -P com7 -c avrisp -b 19200 -U flash:w:gbcf-fw-2.1-usb.hex
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATMEGA8515 avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.13s
avrdude: Device signature = 0x1e9306 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: please define PAGEL and BS2 signals in the configuration file for part ATMEGA8515 avrdude: reading input file "gbcf-fw-2.1-usb.hex" avrdude: input file gbcf-fw-2.1-usb.hex auto detected as Intel Hex avrdude: writing flash (3614 bytes):
Writing | | 0% 0.00s avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64 avrdude: stk500_cmd(): programmer is out of sync
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 26
|
 |
« Reply #10 on: February 20, 2012, 03:45:38 am » |
Tried the baud rate change and this is what I got: C:\>avrdude -p m8515 -P com7 -c avrisp -b 9600 -U flash:w:gbcf-fw-2.1-usb.hex avrdude: stk500_getsync(): not in sync: resp=0xff
avrdude done. Thank you. My email is my username at yahoo, I'll be glad to give the fixed version a try.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 119
Posts: 10179
|
 |
« Reply #11 on: February 20, 2012, 04:12:54 am » |
Email is on the way.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 26
|
 |
« Reply #12 on: February 20, 2012, 04:32:09 am » |
The version you sent me gives even stranger errors than I was getting before... C:\>avrdude -p m8515 -P com7 -c avrisp -b 19200 -U flash:w:gbcf-fw-2.1-usb.hex
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATMEGA8515 avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.10s
avrdude: Device signature = 0x1e9306 avrdude: safemode: Verify error - unable to read lfuse properly. Programmer may not be reliable. avrdude: safemode: To protect your AVR the programming will be aborted
avrdude done. Thank you. It's 1:30am here, so I'm gonna call it a night. But thanks for the help so far. Hopefully, we'll get this sorted...
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 119
Posts: 10179
|
 |
« Reply #13 on: February 20, 2012, 04:41:44 am » |
avrdude -p m8515 -P com7 -c stk500 -v -v -v -b 19200 -U flash:w:gbcf-fw-2.1-usb.hex
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 26
|
 |
« Reply #14 on: March 07, 2012, 09:14:11 pm » |
I started on another project (musical floppy drives  ) so I've ignored this for awhile, and now that I decided to give it another try, I just accidentally broke off a wire end in the header for MOSI (pin 51). Any ideas for removing a wire that's gotten broken off in the pin header?
|
|
|
|
|
Logged
|
|
|
|
|
|