Go Down

Topic: Problem uploading a sketch to ATMEGA2560 (Read 1 time) previous topic - next topic

Globe

Jan 13, 2012, 08:28 pm Last Edit: Jan 13, 2012, 08:32 pm by Globe Reason: 1
I designed a custom board with an ATMEGA2560 MCU. In order to facilitate "electronics debugging" I'm soldering components as I need.

At this moment, as key components, I have the MCU, the 16MHz crystal, ICSP header and FTDI FT232RL. I managed to burn the bootloader (with an AVRISP MKII connected to the ICSP header) with settings as shown in uploaded images. I can also burn sketches code as .hex files using the AVRISP MKII as well.

The problem occurs when trying to upload sketches directly from Arduino 0022 IDE to the FT232RL on the board. The weird part here is that I can only upload the program  immediately after burning bootloader with AVRISP. Any other tries result on a avrdude timeout.






Any hint?

Many thanks in advance.

Coding Badly


You will need to set the "lock bits" to protect the bootloader.  boards.txt (comes with the Arduino IDE) has these settings for Arduino Mega 2560...

mega2560.bootloader.low_fuses=0xFF
mega2560.bootloader.high_fuses=0xD8
mega2560.bootloader.extended_fuses=0xFD

mega2560.bootloader.unlock_bits=0x3F
mega2560.bootloader.lock_bits=0x0F

Globe

Many thanks for your quick reply.

Today I followed your directions and now it works like a charm, allowing me to upload sketches directly from Arduino IDE :D .

Thanks a lot!

Coding Badly


You are welcome.  I'm glad you have it working.

Go Up