View Single Post
Old 02-04-2009, 04:41 PM   #1 (permalink)
rmccomiskie
EcoModding Lurker
 
Join Date: Aug 2008
Location: Massachusetts USA
Posts: 84

Ziggy - '95 Audi S6 Sedan

Manfred - '97 Audi A6 Quattro Sedan
90 day: 20.61 mpg (US)

Clarabell - '03 Audi A4 Quattro Avant

Sherman - '98 Audi A6 Quattro Avant

Cab - '96 Audi Cabriolet
Thanks: 0
Thanked 2 Times in 2 Posts
Unable to Upload Sketch

I'm using the Fundamental Logic MPGuino Kit and I've been playing around with the v0.74 code modifying display screens, etc. It's been running just fine in my car for a couple of weeks.

After my latest change, I was no longer able to upload. Before, when uploading, the screen would go blank for a while and then reboot into the new sketch. Now, it just reboots back into the current sketch splash screen almost immediately after I start the upload. Arduino seems to sit waiting for something for a loooong time and then shows this error:

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

I thought I might have damaged the bootloader or the FTDI drivers or something. I've spent the last 2 days searching the Web for a solution without success. Then I ran across a comment that said that when avrdude is uploading it listens to serial for a while before starting the upload. And that if there's serial being sent by the device, it will wait forever and finally timeout.

In Arduino, I turned on the Serial Monitor and sure enough, the MPGuino is sending this continually: "000.00,000.00,000.00,000.00,000.00"
I assume it's the instant data being sent in loop() using simpletx.

Here's the latest change that I made. I got tired of running through setup every time I plug in the MPGuino so I commented out this line at the beginning of loop():

// if(newRun !=1) initGuino();

This effectively causes the program to jump right into loop() without pausing for setup after rebooting. I'm guessing that when I upload now, avrdude listens to serial and sees data so never begins the upload.

My problem is that I can't stop the serial output without uploading a new sketch and I can't upload a new sketch without stopping the serial output.

I've tried clicking the buttons while starting the upload but it still reboots to the splash screen.

Has anyone had this problem before? Did you find a solution? Is there some way to pause the serial long enough to let avrdude do its thing?

Help!

  Reply With Quote