atmega1284 uploading problem

i§m using atmega1284 with ''mighty atmega1284 using optiboot'' burnloader. I have problem with uploading code. sometimes i upload code sometimes not but mostly not. Can the problem be that i'm using atmega1284 instead of atmega1284p? thanks for everyones help.

succesfull upload with max232(just the end):

avrdude: Recv: . [10] 
######## | 100% 0.18s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0016
         0xa5 != 0xf5
avrdude: verification error; content mismatch
avrdude: Send: Q [51]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 

avrdude done.  Thank you.

unsuccesfull upload with max232(just the end):

avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x62
avrdude: Send: V [56] @ [40] . [00] . [00] . [0c]   [20] 
avrdude: Recv: 
avrdude: stk500_cmd(): programmer is out of sync

unsuccesfull upload with uno rev3(just the end):

avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64
avrdude: Send: V [56] @ [40] . [00] . [00] . [0c]   [20] 
avrdude: Recv: 
avrdude: stk500_cmd(): programmer is out of sync

Many people were having problems with reliable serial communications on their 1284P chips. Several hardware 'fixes' were tried with varying results. But what finally seems to really solve the problem was changing the low fuse byte value to use 'full swing' crystal option, this seemed to fix the problem for everyone that was having the problem.

So check what value of your low fuse byte is and if it presently has a value of 0xFF change it to 0xF7

Lefty

Thanks lefty, unfortunatlly it didn't help much. first upload with max232 worked but others didnt work.
even when i uploaded it i got this:

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x003b
         0x00 != 0x80
avrdude: verification error; content mismatch
avrdude: Send: Q [51]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 

avrdude done.  Thank you.

I don't know what you're using with a MAX232, but that's an older system.
I've only used FTDI USB serial interfaces.

  1. if you're having sync errors, that's probably not related to 1284 vs 1284P,
    but to possible non-recognition of the COMPORT by the IDE related to
    driver installation, or lack thereof. So, the first question is the MAX232
    port showing up in the IDE "Tools > Serial Port" menu?

  2. secondly, there is an issue with trying to burn bootloaders and sketches to
    1284 chips using the 1284 "P" bootloaders, which is related to the different
    signatures of the two chips. See the first couple of posts here,

http://arduino.cc/forum/index.php/topic,144625.0.html

bootloader isn't problem. it was ok without problems. i changed signature and it works. max232 is fine. i can upload codes to uno with it without problems everytime.

What is Xtal frequency?

16mhz

Q:

  1. decoupling? (100uF and few 100nF ceramics close to 1284 and MAX pins)
  2. voltage? 1284 without P might have a problem at 3.3V and 16MHz
  3. upload speed? - start with 38400 or 57600 when possible (115200 @16MHz is 3.7%off - a potential issue when your crystal is off)
  4. Xtal capacitors?
  5. is the automatic reset (dtr to reset via a 100nF cap) working?
  6. 10k pullup on reset
  7. 10k pullup on RxD (optional)
  1. only 1000uf
  2. 5V
    1. i'd try less if i knew how. i guess changing it in baords.txt.
  3. 22pf
  4. yes
  5. yes
  6. no
  1. only 1000uf

Forget this kind of capacitors - it has none decoupling effect with an mcu @16MHz :slight_smile:
You must use few ceramics 100nF at VCC, AVCC against GND (close to the pins, as short leads as possible) and a 10-100uf low-esr tantalum (or a 10uF multilayer ceramic).

Can the problem be that i'm using atmega1284 instead of atmega1284p?

If you're ....

a. 100% certain the bootloader was installed properly, which isn't always obvious
to have occurred, and
b. your comms h.w. is 100%, and
c. you properly tapped into the DTR signal on the comm link [???] to reset the
chip, and
d. you properly changed the signature back and forth between burning the
bootloader and uploading sketches, and
e. your board is well designed with good v.regs and lots of bypass caps,

Then, maybe it's related to the 1284 vs 1284P chips. What lefty mentioned
should fix the 1284P RXD/crystal sensitivity problem, but some people had to
put low-pass filters on the RXD line, eg 1-5K series-R and 100 pF to gnd at
the pin.

You should only need a pullup on RXD if the pin is floating in operation, such as
FTDI cable or MAX232 being disconnected.

Re item c, how is one certain that the MAX232 circuit DTR pin will properly
trigger the Arduino Reset? Probably best to measure it. From what I measured,
DTR at the 0.1 uF cap goes low [5V -> 0V] for the duration of sketch uploading.

wow, thanks that actually hepled. everytime i upload something it says problem uploading to board but MCU starts doing the code. i just add caps