-   OpenGauge / MPGuino FE computer (
-   -   Unable to Upload Sketch (

rmccomiskie 02-04-2009 04:41 PM

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?


rmccomiskie 02-05-2009 09:57 AM

UPDATE: I was able to upload a sketch by pulling the ATmega out of the MPGuino and plugging it into an iDuino. The upload worked. Then I put the ATmega back into the MPGuino and it seems to run normally. The sketch has the serial data commented out. I confirmed that no serial data is now being sent.

Unfortunately, I still cannot upload to the MPGuino!

Since upload to the iDuino works, I assume that the PC side of the USB comm is functioning. The previous sketch was sending serial data and that data was visible in Arduino, so the serial send from the MPGuino is working. But I don't know if the MPGuino receive is working.

Any thoughts on how I can troubleshoot the USB connection on the MPGuino side?

Nevyn 02-05-2009 10:18 AM

Being that they were two different pieces of hardware, they may be on different COM ports. Make sure that the Arduino IDE is on the right COM for the MPGuino.

rmccomiskie 02-05-2009 04:24 PM

Thanks. Yes, I learned early on to do that. Every time I plug in the USB cable, I check the Windows Device Manager to see what port was just assigned. Then I select that port in the Arduino Tools/Serial Port menu.

Since the iDuino uploads without fail and the MPGuino doesn't, I suspect something wrong on the MPGuino. Could be a short but I suspect something messed up in the FTDI chip. I've read that the EEPROM in that chip can be corrupted. I'll have to search for a fix.

At least I have a workaround. It's a hassle to keep pulling the chip every time I want to update the code but it's doable.

Nevyn 02-06-2009 08:08 AM

Check this out:

Arduino Forum - bad brownout changes lock bits? unable to re-d/l

rmccomiskie 02-06-2009 09:42 AM

Thanks for the link. I'm getting by for now swapping the chip back and forth while I wait for my USBtinyISP to arrive. Since the chip works just fine on another board, it has to be something on the MPGuino. I'll mess around with the FT232RL and see if I can reset to factory default settings.

All times are GMT -4. The time now is 02:54 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright