ATmega 1284P upload issue

I have an ATmega 1284P running at 8MHz using the internal oscillator. I am using the maniacbug 8MHz boot loader. I am unable to upload using the serial port. I get this error message…

avrdude: stk500_getsync(): not in sync: resp=0x60

How can I fix this?
Is there another boot loader out there that I can try?

I can upload sketches using ArduinoISP programmer. Serial port works fine in communicating between the mcu and my PC.

Updates for the bootloader and core files were discussed at length in the last week or so. Jack Christensen seems to have captured those files & posted for distribution. Browse 1284 stuff, or maybe browse Jack's posts to find the topic.

Thanks CrossRoads. I looked at the stuff on github. Seems the 8MHz boot loader has not been updated.

DavidOConnor: I have an ATmega 1284P running at 8MHz using the internal oscillator. I am using the maniacbug 8MHz boot loader. I am unable to upload using the serial port. I get this error message...

avrdude: stk500_getsync(): not in sync: resp=0x60

How can I fix this? Is there another boot loader out there that I can try?

I can upload sketches using ArduinoISP programmer. Serial port works fine in communicating between the mcu and my PC.

You don't say what boards.txt entry you are using to try to upload to the bootloader. The boards.txt and the bootloader have to agree on both protocol and speed.

Also, you don't say anything about the DTR reset. Have you checked that is occurring as expected?

Thanks for the suggestions. Here is my boards.txt entry…

atmega1284bb.name=ATmega1284 8MHz internal clock

atmega1284bb.upload.protocol= arduino
atmega1284bb.upload.maximum_size=130048
atmega1284bb.upload.speed=28800

atmega1284bb.bootloader.low_fuses=0xE2
atmega1284bb.bootloader.high_fuses=0xDE
atmega1284bb.bootloader.extended_fuses=0xFE
atmega1284bb.bootloader.path=atmega1284_8Mhz
atmega1284bb.bootloader.file=ATmegaBOOT_1284P_8MHz.hex
atmega1284bb.bootloader.unlock_bits=0x3F
atmega1284bb.bootloader.lock_bits=0x0F

atmega1284bb.build.mcu=atmega1284p
atmega1284bb.build.f_cpu=8000000L
atmega1284bb.build.core=ATmega1284P-revised
atmega1284bb.build.variant=ATmega1284P

I have tried changing the baud rate to a number of different values. The DTR rest appears to be working. At this point I think I will have to build my own boot loader.

DavidOConnor: Thanks for the suggestions. Here is my boards.txt entry...

atmega1284bb.name=ATmega1284 8MHz internal clock

atmega1284bb.upload.protocol= arduino atmega1284bb.upload.maximum_size=130048 atmega1284bb.upload.speed=28800

atmega1284bb.bootloader.low_fuses=0xE2 atmega1284bb.bootloader.high_fuses=0xDE atmega1284bb.bootloader.extended_fuses=0xFE atmega1284bb.bootloader.path=atmega1284_8Mhz atmega1284bb.bootloader.file=ATmegaBOOT_1284P_8MHz.hex atmega1284bb.bootloader.unlock_bits=0x3F atmega1284bb.bootloader.lock_bits=0x0F

atmega1284bb.build.mcu=atmega1284p atmega1284bb.build.f_cpu=8000000L atmega1284bb.build.core=ATmega1284P-revised atmega1284bb.build.variant=ATmega1284P




I have tried changing the baud rate to a number of different values. The DTR rest appears to be working. At this point I think I will have to build my own boot loader.

For your reference, here's the 8MHz boards.txt I have. A few differences: I'd start by changing your protocol from arduino to stk500v1. Your Fuse settings will be different, of course, to reflect your clock choice, but I'd have a close look at those anyway just to make sure everything is sensible, and to compare with the fuse settings here.

mighty8.name=Original Mighty 1284p 8MHz
mighty8.upload.protocol=stk500v1
mighty8.upload.maximum_size=129024
mighty8.upload.speed=28800
mighty8.bootloader.low_fuses=0xff
mighty8.bootloader.high_fuses=0xdc
mighty8.bootloader.extended_fuses=0xfd
mighty8.bootloader.path=standard
mighty8.bootloader.file=ATmegaBOOT_1284P_8MHz.hex
mighty8.bootloader.unlock_bits=0x3F
mighty8.bootloader.lock_bits=0x0F
mighty8.build.mcu=atmega1284p
mighty8.build.f_cpu=8000000L
#mighty8.build.core=arduino:arduino
mighty8.build.core=standard
mighty8.build.variant=standard

How about an 8MHz version of Optiboot? Are you set on 28800 baud or would 57600 be OK?

DavidOConnor:
Seems the 8MHz boot loader has not been updated.

That is correct. On the agenda but haven’t gotten to it yet.

DavidOConnor:
At this point I think I will have to build my own boot loader.

Try the attached. One for 28.8k baud, and a couple faster ones :smiley:

Haven’t tried 'em myself (my 1284Ps are 16MHz) but I think they should work. Please let me know either way.

optiboot_1284p_8MHz_28.8k.hex (1.41 KB)

optiboot_1284p_8MHz_57.6k.hex (1.41 KB)

optiboot_1284p_8MHz_500k.hex (1.41 KB)

Thanks guys! Wish I checked back sooner. I just finished modifying the 1.05 distribution optiboot boot loader. Tested at 38400 baud and seems to be working ok.

I'd like to up the baud rate but I'm not sure how fast I can go using the internal oscillator. Does anyone know what the baud rate limit is using an uncalibrated internal oscillator?

DavidOConnor: Does anyone know what the baud rate limit is using an uncalibrated internal oscillator?

Depends on the calibration of the individual part. You pays your money and you takes your chances. See table 19-11 in the datasheet. 38.4k is a good speed, 0.2% error, but 250k and 500k are 0% error. So even if the internal osc is off a couple percent, they might work. I'd give those a try, just on a lark.

LOL when you said 8MHz I didn't think internal osc at all. So I just set the fuses on my board for 8MHz internal osc, burned the 500k baud bootloader above and successfully uploaded a sketch that's just slightly over 32kB three times in a row. YMMV!

PS: The internal RC osc on this particular MCU is running at about 8.048MHz, so about 0.6% error, should be plenty good for serial comm. But it's also not as stable as a crystal, and varies over about a 19kHz range, so about ±0.12%

PPS: After warming up a few minutes, things settled down quite a bit to about 8.035MHz and only about a 3kHz range.