Can't reprogram Duemilanove anymore

Hi,

Hope you guys aren't getting sick of this question but... I can't reprogram my Arduino anymore for some reason. Yep, it's that message:

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

However, I programmed the same board several times already, so initially it was working. The last thing I did was reprogramming it with a more advanced program. I'm not sure if a faulty program can screw your board, but it wouldn't surprise me if that program has several pointer errors. Anyway, after uploading that program LED 13 started to flicker very rapidly, and I wasn't being able to reprogram anymore. Neither on another computer.

For the info, the program read/writes from the serial port to operate a XBee shield. Further there are no inputs or outputs used. The shield was removed during programming.

This is what the LEDS are doing: - Green power LED is always on - After plugging in the usb (powering the Arduino), TX and RX blink a few times in the very beginning. Then Pin 13 will flicker very quickly for about half a second, pause half a second. This repeats 6 or 8 times. Then all LEDS's stop blinking, except the green power LED. - When resetting, LED 13 will flicker keep flickering quickly continiously. - When trying to reprogram, the RX LED will blink 3 times shortly, then LED 13 again starts flickering quickly non stop. After ~15 seconds the IDE gives me the error message from above. No matter what program I try (tried the simple Blink example program for uploading.)

Does the current program block the communication or something?

Specs: Arduino Duemilanove, ATMega 328P-PV, ~3 months old. Using the USB cable to program.

Regards, Rick

Ah, thank the Microcontroller Gods I fixed it. But I'd like to know what causes this now.

For those with similiar problems, I think uploading was impossible due heavy Serial traffic. So what I did: 1- Put the USB cable in another port (that flushes buffers maybe?) 2- While doing so, I kept the reset button down on the board 3- Opened a simple "Blink" sketch 4- Click the Upload button -> Still holding the reset button! 5- It takes a while (~1 or 2 seconds) before the "Binary Sketch size" was estemated. Keep that reset button down until you'll see this line. Now release it, and just hope the uploader will query the Serial port at the right time. If it's too late, your previous program will probably block Serial communication again.

Not sure if it's all true, but it worked for me. I guess step 5 may need a good timing and luck. Anyhow, should I program a longer delay before initializing Serial communications to prevent this next time?

Cheers! Rick