Pages: [1]   Go Down
Author Topic: Sketches Only Upload Once  (Read 1062 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 1
Posts: 185
www.rocketscream.com
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
Code:
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.  smiley-eek

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

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16540
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 185
www.rocketscream.com
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. smiley-sad
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16540
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. smiley-sad

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

Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 185
www.rocketscream.com
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Lefty,

It works with your trick. smiley 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?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16540
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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

Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 185
www.rocketscream.com
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16540
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 185
www.rocketscream.com
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lefty,

I attach the schematic. I think it's pretty standard.  smiley-lol

* schematic.pdf (60.95 KB - downloaded 6 times.)
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16540
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lefty,

I attach the schematic. I think it's pretty standard.  smiley-lol


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
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 185
www.rocketscream.com
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. smiley

Now, I'm going to try to use Optiboot. smiley

Thank you for spending your Sunday on helping me!
Logged

Pages: [1]   Go Up
Jump to: