Go Down

Topic: Need help with mega644 + max232 on breadboard (Read 1 time) previous topic - next topic

tmahring

Hi
I'm trying to build an arduino on a breadboard using a Atmega644 and a MAX232.
I hooked up the max232 as it is shown in this schematics:
http://www.freeduino.org/files/duino232/Duino232-2.png
The serial connection works fine, i uploaded a small programm, which just receives chars and sends them back, directly to the chip via isp.
Reset via the DTR Line also works.

I uploaded the sanguino bootloader which i recompiled to use only 9600 baudrate. I also changed the CPU type to match my 644 instead of the default 644P and changed the clock settings to match my 20MHz. The bootloader seems to be working -> the LEDs blink and when i open a terminal and keep hitting '1' and ' ' I'm getting the "AVR ISP" response.

However, I cannot upload anything via the bootloader. Everytime I try I get this error:
Code: [Select]
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51


Here is my boards.txt section:
Code: [Select]
atmega644.name=Sanguino W/ ATmega644

atmega644.upload.protocol=stk500
atmega644.upload.maximum_size=63232
atmega644.upload.speed=9600

atmega644.bootloader.low_fuses=0xFF
atmega644.bootloader.high_fuses=0xDC
atmega644.bootloader.extended_fuses=0xFD
atmega644.bootloader.unlock_bits=0x3F
atmega644.bootloader.lock_bits=0x0F

atmega644.bootloader.path=atmega644
atmega644.bootloader.file=ATmegaBOOT_644.hex
atmega644.build.mcu=atmega644
atmega644.build.f_cpu=20000000L
atmega644.build.core=arduino


Anyone an idea ?

Checkers1811

Have you checked the Fuses?

Be sure that BOOTRST is set or the bootloader will not work right.

I have been using an 8mHz crystal, so I have FF D7 FF for the fuses.

ReSiStAnCe

This is from the original boards.txt:

Code: [Select]
##############################################################
atmega644.name=Sanguino W/ ATmega644P
atmega644.upload.protocol=stk500
atmega644.upload.maximum_size=63488
atmega644.upload.speed=57600
atmega644.bootloader.low_fuses=0xFF
atmega644.bootloader.high_fuses=0x9A
atmega644.bootloader.extended_fuses=0xFF
atmega644.bootloader.path=atmega
atmega644.bootloader.file=ATmegaBOOT_168_atmega644p.hex
#atmega644.bootloader.file=ATmegaBOOT_644P.hex
atmega644.bootloader.unlock_bits=0x3F
atmega644.bootloader.lock_bits=0x0F
atmega644.build.mcu=atmega644p
atmega644.build.f_cpu=16000000L
atmega644.build.core=arduino

##############################################################

I played around a little with the fusecalculator found here: http://www.engbedded.com/fusecalc

By setting the high fuse to 0xDC you limit the size of your bootloader to 1024 words, whereas the 'original' is 2048 words.
For it to be 2048 again, it must be 0xDA. In the original boards.txt the JTAG interface is enabled, hence the 0x9A.

Hope this helps.

Go Up