Hardware Reference
In-Depth Information
Figure 11-5: Colliding UART communication lines
Note the collision callout in Figure 11-5. Consider what would happen if both
the XBee and your computer tried to transmit data to the Arduino. How does the
Arduino know where the data is coming from? More importantly, what happens
if both try to transmit to the Arduino at the same time? The data will “collide,”
causing garbled data that cannot be properly interpreted by the Arduino.
Because of this collision condition, and complexities regarding the drivers
for these I/O ports, you cannot program the Arduino or talk to it from your
computer while the XBee is connected to the Arduino's serial port. You can deal
with this in two ways:
You can unplug the XBee shield every time you want to program your
Arduino.
You can use a jumper or switch on the XBee shield to switch whether or
not the XBee is connected through to the Arduino.
When you want to program your Arduino, you need to either remove the
XBee shield, or be sure to set your shield's jumper/switch so that the XBee is
disconnected.
Hardware vs. Software Serial UART Connection Option
In this chapter, you use only the “hardware” UART port of your Arduino to
communicate with your XBee (pins 0 and 1 on your Arduino). As explained
in the preceding section, these pins are also used for the USB connection to
Search WWH ::




Custom Search