
Operation
Serial buffers
XBee Wi-Fi RF Module User Guide
37
If the output buffer is empty, the SPI serializer transmits the last valid bit repeatedly, which may be
either high or low. Otherwise, the device formats all output in API mode 1 format, as described in
. The attached host is expected to ignore all data that is not part of a formatted API frame.
Serial buffers
The XBee Wi-Fi RF Module maintains internal buffers to collect serial and RF data that it receives. The
serial receive buffer collects incoming serial characters and holds them until the device can process
them. The serial transmit buffer collects the data it receives via the RF link until it transmits that data
out the UART or SPI port. The following figure shows the process of device buffers collecting received
serial data.
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, even in TCP mode.
UART flow control
You can use the RTS and CTS pins to provide RTS and/or CTS flow control. CTS flow control provides an
indication to the host to stop sending serial data to the device. RTS flow control allows the host to
signal the device to not send data in the serial transmit buffer out the UART. To enable RTS/CTS flow
control, use the
D6
and
D7
commands.
Note
Serial port flow control is not possible when using the SPI port.