USB Programming with XBee connected

Hi

I am not sure if this is the correct area to post this question, but as the title says I need to know if it is possible to program an arduino mega 2560 via a USB connection when an XBee shield with the XBee is connected to it. I tried this but never succeeded. Is there any specific work around I should follow or it is simply not possible.

Thanks in advance

ksp

I think I have come across this second hand before now, but never had an Xbee to try it with.

The Xbee communicates through serial - this uses the pins 0 and 1, which are also connected to the USB chip for the USB serial connection used in programming.

With the Xbee connected the serial signals get interfered with by the Xbee. The only reliable way I know of to program it is to remove the Xbee. A pain, I know.

If you can re-assign the pins that the Xbee uses then you might be able to get it going using SoftwareSerial instead of the hardware UART. This would stop the thing from interfering with the serial communications.

Thank you. I thought that it is pain if both use the same pins. But just put it here to see if there is any work around for that.

ksp

I need to know if it is possible to program an arduino mega 2560 via a USB connection when an XBee shield with the XBee is connected to it.

That would depend on which XBee shield you are using, and which jumper/switch position is in use. I use the Sparkfun XBee shield. Flip the switch one way, load the sketch, flip the switch the other way, and the XBee is back connected to the hardware serial port.