xbee program downloading problem

Hello There,

I got two xbee shields from sparkfun and the series 1 xbee chip antennas.
I am trying to make two xbees talk to each other. So I used two arduino uno boards, two xbee antennas and two xbee shields.
While I'm trying to upload code to the arduino boards, it always fails with these errors:
avrdude: stk500_getsync(): not in sync: resp=0x86
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

But if I take the xbee shield and xbee off of the arduino board, I can upload the code to the arduino board without any problem.
Does anyone know what might be causing the problem? I tried disconnect the board and then connect it again, I also tried pressing the reset button. Neither worked...

Thank you!
Yuping

But if I take the xbee shield and xbee off of the arduino board, I can upload the code to the arduino board without any problem.
Does anyone know what might be causing the problem?

I think you know the answer to this question. The XBee shield is causing the problem.

Knowing WHICH XBee shield you are using is necessary to help you define a solution.

Thanks for replying, PaulS!
The xbee shield I am using is the one from sparkfun. This one http://www.sparkfun.com/products/9976
I soldered the sockets and plugged it directly on to the Arduino Uno board...

There is a switch on that board that selects the connection between the XBee and either pins 0 and 1 or 2 and 3. When the switch is in the UART position, the XBee interferes with the ability to upload sketches. Simply move the switch to the other position to upload, and back to run.

What Paul S said.

Or better yet, instead of using the hardware serial to talk to the xBee, use NewSoftSerial on pins 2 and 3, and leave the switch in that position. This way you can upload at will, and use the hardware serial for debugging.

Thanks guys! It's uploaded correctly and is running!!
Thanks a lot!! :slight_smile: