Serial communication
Select a serial port
The device has two serial ports and only one is active at a time. To be active, a port must be enabled
and in use.
The UART is always enabled. The SPI is enabled if it is configured. To be configured, SPI_MISO, SPI_
MOSI, SPI_SSEL , and SPI_CLK must all be configured as peripherals. On the surface-mount device,
these lines are configured as peripherals by setting P5, P6, P7, and P8 to 1. This is also the default
configuration for surface-mount devices.
On the through-hole device, those pins are not available and SPI is disabled by default. Therefore, to
configure the SPI pins on a through-hole device, hold DOUT low during a reset. If the UART is not
hooked up, then DOUT can be treated as an input to force the device into SPI mode. It is best to follow
this special operation by a WR operation so that the SPI port will still be enabled on future resets
without forcing DOUT low.
Once the SPI port is enabled by either means, it is still not active until the external SPI master asserts
SPI_SSEL low. After the SPI port is active, the device continues to use the SPI port until the next reset.
Serial receive buffer
When serial data enters the device through the DIN pin (or the MOSI pin), it stores the data in the
serial receive buffer until the device can process it. Under certain conditions, the device may not be
able to process data in the serial receive buffer immediately. If large amounts of serial data are sent
to the device such that the serial receive buffer would overflow, then it discards new data. If the UART
is in use, you can avoid this by the host side honoring CTS flow control.
Serial transmit buffer
When the device receives RF data, it moves the data into the serial transmit buffer and sends it out
the UART or SPI port. If the serial transmit buffer becomes full and the system buffers are also full,
then it drops the entire RF data packet. Whenever the device receives data faster than it can process
and transmit the data out the serial port, there is a potential of dropping data.
UART port
UART data flow
The XBee/XBee-PRO S2C DigiMesh 2.4 RF Module device's UART performs tasks such as checking
timing and parity, which is required for data communications.
Devices that have a UART interface connect directly to the pins of the XBee/XBee-PRO S2C DigiMesh
2.4 RF Module as shown in the following figure. The figure shows system data flow in a UART-
interfaced environment. Low-asserted signals have a horizontal line over the signal name.
XBee S2C DigiMesh 2.4 User Guide
Select a serial port
38