Fuse corruption after uploading Servo Example.

Specs:
IDE: Arduino0022
Sketch: Examples>Servo>Sweep
Board: Duemilanove
Chip: ATmega328P-PU

Problem:
As the title states, after uploading the Sweep sketch which completes successfully. The board will reset the chip as normal however when it returns to its functioning state the led (pin13) will blink rapidly. Searching around i found an article that suggests that something occurs that allows the watchdog timer to reset the pin. Since the watchdog timer occurs every 1/4 second the chip can do nothing but blink the led before the next reset occurs.

Attempting an upload of the Blink sketch will result in an AVRDude error regarding the programmer being out of sync. Using the USBTiny programmer to burn a new boot loader is the only thing that will bring the chip back to a working state.

I don't know if this is the right section to put this post into. Just thought i should throw it out there. This is reproducible every time i upload the Sweep sketch. Even while using different ATmega328 chips.

(deleted)

What fuse settings are you using?

atmega328.name=Arduino Duemilanove or Nano w/ ATmega328

atmega328.upload.protocol=stk500
atmega328.upload.maximum_size=30720
atmega328.upload.speed=57600

atmega328.bootloader.low_fuses=0xFF
atmega328.bootloader.high_fuses=0xDA
atmega328.bootloader.extended_fuses=0x05
atmega328.bootloader.path=atmega
atmega328.bootloader.file=ATmegaBOOT_168_atmega328.hex
atmega328.bootloader.unlock_bits=0x3F
atmega328.bootloader.lock_bits=0x0F

atmega328.build.mcu=atmega328p
atmega328.build.f_cpu=16000000L
atmega328.build.core=arduino

appear to be the same.

(deleted)

I don't hook up the circuit till after i upload the code. So it happens with no circuitry attached. If i was to hook it up it would be
red -> 5v
black -> gnd
white -> pwm pin (9)

(deleted)

Have you tried loading other sketches? Cant see a reason why its resetting!!

Yea, I have been working on a project with repeated uploads. Uploads fine every time. It's just with the servo examples that the chips go nuts. I noticed in the Servo.h file that the timers are manipulated so that the timing of the servo pulses can use the internal interrupts.

I don't have an earlier version of the Arduino IDE to test, but the Servo.* source files are dated 2009. Wonder if it could be possible that something in the newer revisions of the Arduino IDE are conflicting with some of the settings implemented within the Servo Library.

(deleted)

I can use the optiboot bootloader on the Duemilanove ? Do i have to change anything under the board.txt file? I notice that it transfers at a higher baud that's why i ask.

(deleted)

EvolveElectronics:
I can use the optiboot bootloader on the Duemilanove ? Do i have to change anything under the board.txt file? I notice that it transfers at a higher baud that's why i ask.

Yes, you can burn the optiboot bootloader onto a 328p chip and run it on a Duemilanove board, however from then on you must select it as a Uno board in the IDE.

Lefty

I can use the optiboot bootloader on the Duemilanove ? Do i have to change anything under the board.txt file? I notice that it transfers at a higher baud that's why i ask.

Yes, you can burn the optiboot bootloader onto a 328p chip and run it on a Duemilanove board, however from then on you must select it as a Uno board in the IDE.

Awesome, i will try that tomorrow after work and let you know if it clears up the problem. Thanks for the response.

just to verify the Optiboot bootloader solved the servo upload problem. Not sure what it was but i got the STK500 programmer not responding error for the first 3 attempts at upload. On the fourth attempt it uploaded fine.

Thanks for all the help.

Crap, wish I would have read this before loading in on two of my Duemilanove boards. :frowning: So the only way to resolve this is to re-flash the bootloader?

So the only way to resolve this is to re-flash the bootloader?

Only way to resolve what?

The same problem as stated in the first post of this thread:

Problem:
...after uploading the Sweep sketch which completes successfully. The board will reset the chip as normal however when it returns to its functioning state the led (pin13) will blink rapidly. Searching around i found an article that suggests that something occurs that allows the watchdog timer to reset the pin. Since the watchdog timer occurs every 1/4 second the chip can do nothing but blink the led before the next reset occurs.

the led on pin 13 just blinks, I'm unable to connect and upload a new sketch to the chip.