atmeg2560 board

Hi There,

I recently designed a board around the atmega2560 running at 3.3V and 8 MHz. I'd like to use the internal RC oscillator at 8 MHz. In the boards.txt file I added the following:

mega2560_no_extclk.name=Arduino Mega 2560 w/ Internal 8MHz RC

mega2560_no_extclk.upload.protocol=wiring
mega2560_no_extclk.upload.maximum_size=258048
mega2560_no_extclk.upload.speed=115200

mega2560_no_extclk.bootloader.low_fuses=0xE2
mega2560_no_extclk.bootloader.high_fuses=0xD8
mega2560_no_extclk.bootloader.extended_fuses=0xFD
mega2560_no_extclk.bootloader.path=stk500v2
mega2560_no_extclk.bootloader.file=stk500boot_v2_mega2560.hex
mega2560_no_extclk.bootloader.unlock_bits=0x3F
mega2560_no_extclk.bootloader.lock_bits=0x0F

mega2560_no_extclk.build.mcu=atmega2560
mega2560_no_extclk.build.f_cpu=8000000L
mega2560_no_extclk.build.core=arduino
mega2560_no_extclk.build.variant=mega

The only difference between this and the default mega2560 entry is that I've changed the build.f_cpu to 8 MHz and I've changed the low fuse to reflect the 8 MHz RC oscillator.

When I try to burn the bootloader I get the following error:

avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 197.19s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x3e000
0x0d != 0xff
avrdude: verification error; content mismatch

Any thoughts or ideas? What am I missing/doing incorrectly? Thanks!

D

This is the error you usually see when you try to load a bootloader into a 2560 using a programmer like the USBTINY or ArduinoISP that doesn't really support more than 128k (64k words) of program space. Avrdude is smart enough to program the high memory anyway, but it does the verify wrong.
Your chip PROBABLY has an OK bootloader loaded at that point.

Note that unless you recompiled the bootloader, you haven't change the serial bitrate constants that it uses, and your upload will need to run at 57600bps instead of 115200bps. (you may find that the bootloader doesn't work at 115200bps even if you DO recompile...)

I see. Thanks so much for the reply. I am indeed using a usbtiny programmer. Thanks for the info!

I'm planning to do the same. Did you succeed?

Thanks!

-Tuxuser

Atmega2560 is not spec'ed to run that slow:

Speed Grade:
– ATmega640V/ATmega1280V/ATmega1281V:
• 0 - 4MHz @ 1.8V - 5.5V, 0 - 8MHz @ 2.7V - 5.5V

– ATmega2560V/ATmega2561V:
• 0 - 2MHz @ 1.8V - 5.5V, 0 - 8MHz @ 2.7V - 5.5V

– ATmega640/ATmega1280/ATmega1281:
• 0 - 8MHz @ 2.7V - 5.5V, 0 - 16MHz @ 4.5V - 5.5V

– ATmega2560/ATmega2561:
• 0 - 16MHz @ 4.5V - 5.5V

Are you using a 2560V instead?

CrossRoads:
Atmega2560 is not spec'ed to run that slow:
...
– ATmega2560/ATmega2561:
• 0 - 16MHz @ 4.5V - 5.5V

Eeerm... isn't 8MHz between 0 and 16MHz?

Sorry - I meant it's not spec'ed to run that Low: 3.3V.