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.

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

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,

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 16MHz3. 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 reset7. 10k pullup on RxD (optional)

Forget this kind of capacitors - it has none decoupling effect with an mcu @16MHz 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).

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, andd. you properly changed the signature back and forth between burning the bootloader and uploading sketches, ande. 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 mentionedshould 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.