Sketches Only Upload Once

Hi Everyone,

I burn an Arduino Pro Mini 8 MHz bootloader on a ATmega328 chip using Arduino Uno (as ISP) and also an AVRISP MKII.
Bootloader burning process is ok.
I managed to upload the Blink sketch once and the board works.
But, on 2nd attempt to upload sketch (even the same Blink sketch with different blinking rate), it always fail to upload.
I would get the classic error:

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

I tried burning the bootloader again and even with a second unit, the outcome is the same. :astonished:

Do you guys think this has something to do with the waiting time in the bootloading stage?

Is your ATmega328 running on a breadboard or standalone? If so do you have a auto-reset circuit wired up? If not have you learned the proper manual reset timing needed to upload correctly?

Lefty

Hi Lefty,

It's an ATMega328 on a small breakout board with the FTDI 6 pin header together with the reset capacitor.
It's weird because it upload once but not the 2nd and so on. :frowning:

48X24X48X:
Hi Lefty,

It's an ATMega328 on a small breakout board with the FTDI 6 pin header together with the reset capacitor.
It's weird because it upload once but not the 2nd and so on. :frowning:

Well try a manual reset upload. Press and hold down a reset switch (install a switch if needed). When you see the IDE report the compiled sketch size in the output window, release the reset button.

Lefty

Hi Lefty,

It works with your trick. :slight_smile: I just tried it. I can remember you clearly on the forum because of this!

So, the issues comes down to the waiting stage in bootloader?

So, the issues comes down to the waiting stage in bootloader?

No, the issue is with your 6 pin FTDI pin cable not auto-resetting the board. Either you have the wiring wrong for the DTR signal via cap to your reset pin, or the device is not working correctly as far as DTR activation.
Check your wiring and if you have a link to the cable you have let us look at it.

Lefty

I'm using a simple FT232 breakout. I double check the wiring, point-point everything seems to be connected properly.
I also tried using Sparkfun - http://www.sparkfun.com/products/9873
Both came out with the same result.

But, I manage to get it to upload once everytime after bootloader burning process.
I repeated this couple of times and it's constantly the same pattern.

48X24X48X:
I'm using a simple FT232 breakout. I double check the wiring, point-point everything seems to be connected properly.
I also tried using Sparkfun - http://www.sparkfun.com/products/9873
Both came out with the same result.

But, I manage to get it to upload once everytime after bootloader burning process.
I repeated this couple of times and it's constantly the same pattern.

Do you have a drawing of how you have your DTR to reset wiring? Do you have a pull up resistor on the reset pin? Are you sure of the size of cap to use? It should be able to work especially that sparkfun module, I have one and the DTR works fine with mine.

Lefty

Lefty,

I attach the schematic. I think it's pretty standard. XD

schematic.pdf (60.9 KB)

48X24X48X:
Lefty,

I attach the schematic. I think it's pretty standard. XD

I wonder if that diode D2 and cap C8 on the reset pin could be preventing the DTR pulse through a series cap (.1mfd) from reaching it's proper level? I've never seen those two components used on any arduino designed board that uses the auto reset feature.

Lefty

Lefty,

The diode and capacitor are for usage in noisy environment to prevent unnecessary reset. This was recommended by Atmel in their application note.

The capacitor is the cause for it not to reset (or at least take too much time to discharge).
I would have to remove it but the diode I'm keeping it. :slight_smile:

Now, I'm going to try to use Optiboot. :slight_smile:

Thank you for spending your Sunday on helping me!