Custom ATmega2560 board - uploading works but not running

Dear all,

I have a problem getting a custom board with Atmega2560 chips to work.

Basically, the PCB contains two Atmega2560 with their own oscillators, decoupling capacitors, ICSP headers and everything else like on the Arduino Mega 2560. I use a Arduino Mega 2560 with the ArduinoISP sketch as a programmer and am able to upload the bootloader without problems. After uploading the bootloader, I tried to upload a modified Blink sketch which should blink LEDs that are connected to several pins but nothing happens.

The Atmega2560 chips both respond properly when programming but do not seem to execute the code they were programmed with. I have used the standard bootloader but modified the high fuse to be 0xD9 instead of the default 0xD8 to reflect the fact that I am loading the code with a programmer. The same way of programming worked just fine on another self-made board using the Atmega2560 chip.

Any idea what could cause the Atmega2560 to respond to the programming and accept uploads but not execute them? Did anyone ever experience a similar issue? Any help would be greatly appreciated!

Thanks!

BlinkBlink:
Dear all,

I have a problem getting a custom board with Atmega2560 chips to work.

Basically, the PCB contains two Atmega2560 with their own oscillators, decoupling capacitors, ICSP headers and everything else like on the Arduino Mega 2560. I use a Arduino Mega 2560 with the ArduinoISP sketch as a programmer and am able to upload the bootloader without problems. After uploading the bootloader, I tried to upload a modified Blink sketch which should blink LEDs that are connected to several pins but nothing happens.

The Atmega2560 chips both respond properly when programming but do not seem to execute the code they were programmed with. I have used the standard bootloader but modified the high fuse to be 0xD9 instead of the default 0xD8 to reflect the fact that I am loading the code with a programmer. The same way of programming worked just fine on another self-made board using the Atmega2560 chip.

Any idea what could cause the Atmega2560 to respond to the programming and accept uploads but not execute them? Did anyone ever experience a similar issue? Any help would be greatly appreciated!

Thanks!

look at you reset signal.
Post you CPU schematic.

chuck.

Thanks for your reply!

I suspect that the RESET signal is fine since uploading works fine and I never get any out of sync errors or anything similar.

Attached please find a PDF with the circuits around the two µCs.

Thanks!

Monitoring1.pdf (574 KB)

Monitoring2.pdf (716 KB)

BlinkBlink:
Thanks for your reply!

I suspect that the RESET signal is fine since uploading works fine and I never get any out of sync errors or anything similar.

Attached please find a PDF with the circuits around the two µCs.

Thanks!

Measure the Voltage on your !Reset. I had trouble with MEGA2560's requiring large pullup currents on Reset.

Vrst is defined to be between 0.2Vcc and 0.9Vcc, So if you are running the MEGA2560 at 5V for Vcc, !RESET must be above 4.5V to guarantee the processor is not in Reset.

ISP will work just fine if reset is low!

Chuck.

chucktodd:
Measure the Voltage on your !Reset. I had trouble with MEGA2560's requiring large pullup currents on Reset.

Vrst is defined to be between 0.2Vcc and 0.9Vcc, So if you are running the MEGA2560 at 5V for Vcc, !RESET must be above 4.5V to guarantee the processor is not in Reset.

ISP will work just fine if reset is low!

Chuck.

Thanks for the information about the !RESET signal. I measured a Vcc of 4.99V and a !RESET of 4.99V so I think this should be fine and the µCs are not in reset. Still not performing any actions defined in the code...

Maybe the image ended up in the wrong location in the target.

It is a good idea to use avrdude 6.1 instead of 6.01.
The combo ArduinISP sketch + avrdude 6.01 does not properly support flash > 128KB.

Avrdude 6.01 could work too, but then you must make sure you change hfuse to 0xD9 before uploading the sketch with the programmer.

I would advise to read back in the image and verify the sketch arrives correctly at 0x00000. Do this with avrdude 6.1, with 6.01 you never are 100% sure what happens. (see here for more info). (Don't trust on the fact that verification succeeded: if it wrote the image in a wrong location, it will read from that location too).