Arduino Fio firmware update

Ok, so I’ve been trying to troubleshoot this problem for about a week, to no success. So I am turning to the forum gods for assistance.

I have an arduino Fio (atmega328p), 2-xbees (series 2, unfortunately), and the xbee USB explorer. I was able to upload sketches to the Fio successfully using the Xbee’s.

In trying to learn the coding, I uploaded the Arduino Example sketch DigitalReadSerial, and forgot to change the Baud Rate from 9600 to 57600. That sketch uploaded successfully.

However, since then, I have not been able to upload any sketches successfully.

This is the error I get, but it seems pretty vague:

avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0xe0

I tried changing the BD to 9600 on the Xbees, but that didnt work. I tried resetting all the Xbee conditions, but that didnt work. I am certain the xbee’s are communicating because in serial monitor, i get a steady stream of “àààààà”

my searches show that its likely because the DigitalReadSerial immediately turns on Serial.begin, and Serial.println without any delays, which causes the arduino to be overloaded. The only solution to this I’ve seen is to update the firmware to “erase” the current sketch on the arduino. This site gives instructions:

http://arduino.cc/en/Hacking/DFUProgramming8U2

But I am using mega328p, not 8u2 (or the uno). I tried the flip software, but they have nothing for the Fio. So I am not able to update the firmware to solve my issue. Has anyone had success in similar situations as mine?

Also, I was thinking that maybe my problem is timing. I tried resetting at many different times during upload, none of them successful. Is it possible that the Xbee communication is too slow to trigger sketch upload in the small time frame between start-up and serial begin? If this is the case, would buying an FTDI cable to do wired upload of a sketch solve my problem?

thanks in advance

It sounds like a timing mismatch!

Try setting both of your xbee’s to 9600 bautrate and then the communications with your wrong sketch should work.

If it doesn’t, then remove the xbees from you explorer en the Fio and connect the “UART Data out” to the “UART Data In” and your “UART Data in” to the “Uart Data Out” on your Fio. And connect the Grounds to each other (GND).

See http://code.google.com/p/xbee-api/wiki/XBeePins for the pin layout.

Open the Arduino IDE and go to the serial communication screen. Check wheter the data is now correct. If it is not then try changing the bautrate.

Now try to upload your correct arduino sketch again. And set the xbee’s to the same bautrate as your sketch. And plug the xbees back into there sockets

I hope this helps.

Thanks ingmarHendriks,

I tried the way you suggested but I couldnt resolve it. I ended up buying an FTDI interface, and plugged the fio into the computer directly, and that fixed my problem. I am now able to upload again.

have you setup the auto reset. http://www.sparkfun.com/tutorials/122#Step3 Shows you how, It seems to work good for me at 57600 baud, also I’m using the Firmware that came on the Fio