FIGURE 1. Note that the XBee-PRO uses double buffering in addition to flow control to throttle incoming and outgoing data.
PIC32MX795F512H using one of its many UART interfaces.
CMOS logic levels at the XBee-PRO serial interface eliminate
the need for RS-232 level translators such as the ST3232. A
logical low pulse signals a START bit with the eight-bit data
packet ending with a logically high STOP bit.
The XBee-PRO datasheet states that the RF data rate is
250 Kbps. However, the XBee-PRO serial interface data rate
ranges between 1,200 bps and 1 Mbps. The serial I/O to RF
I/O data rate disparity is obvious to the most casual
observer. If the RF data rate is capped at 250 Kbps, an
uncompressed 1 Mbps serial stream cannot be transmitted
or received without some trickery. It can come close to
being done if you use transmit and receive buffers in
combination with flow control. The XBee-PRO stores
incoming serial data from the host UART in an internal
serial receiver buffer until the data can be processed out
through the XBee-PRO’s transmitter.
If the incoming serial data looks as if it will overflow
the serial receiver buffer, the active-low CTS (Clear To Send)
signal is deasserted by the XBee-PRO until the receive buffer
is out of danger of overflowing. The active-low CTS signal is
used to signal the sending UART to cease sending data
when the XBee-PRO’s serial receiver buffer is 17 bytes away
from overflowing. When the serial receiver buffer is drained
to contain at least 34 free bytes, CTS is reasserted and
serial data transfer from the host can resume.
The receive serial data flow process works in a similar
fashion to the transmit process and can be controlled by
the host using the active-low RTS (Request To Send) signal.
No incoming RF data is allowed to be processed out of the
XBee-PRO’s serial transmit buffer into the host UART if RTS
RTS and/or CTS flow control is not mandatory.
However, if you wish to invoke flow control, heed the
warnings found in the XBee-PRO datasheet. For instance,
don’t hold RTS inactive long enough to overrun the buffer,
as a buffer overrun tosses the data in the buffer into the
spittoon. Fred’s First Rule of Embedded Computing applies
here and states that in the world of embedded computing,
nothing is free. Thus, after all of the overhead is accounted
for, the actual maximum data throughput for an XBee-PRO
maxes out at 35 Kbps. As far as the mechanics of the XBee-PRO’s flow control and buffer scheme are concerned,
Figure 1 says it all without saying a word.
PHOTO 2. There are a bunch of pins on these puppies.
However, we only need to use four of them to get on the air.
I’ve dropped three of the XBee-PRO module variants onto
the backdrop in this shot.
SERVO 05.2010 55