
Serial communication
Serial buffers
Digi XBee3 Cellular LTE-M/NB-IoT Global Smart Modem User Guide
135
Serial buffers
The XBee Smart Modem 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 serial or SPI port.
CTS flow control
We strongly encourage you to use flow control with the XBee Smart Modem to prevent buffer
overruns.
CTS flow control is enabled by default; you can disable it with
. When the serial receive
buffer fills with the number of bytes specified by
, the device de-asserts
CTS (sets it high) to signal the host device to stop sending serial data. The device re-asserts CTS when
less than FT-32 bytes are in the UART receive buffer.
Note
Serial flow control is not possible when using the SPI port.
RTS flow control
If you set
to enable RTS flow control, the device does not send data in the serial
transmit buffer out the DOUT pin as long as RTS is de-asserted (set high). Do not de-assert RTS for
long periods of time or the serial transmit buffer will fill.
Enable UART or SPI ports
To enable the UART port, configure DIN and DOUT (
P3
and
P4
parameters) as peripherals. To enable
the SPI port, enable SPI_MISO, SPI_MOSI, SPI_SSEL , and SPI_CLK (
P5
through
P9
) as peripherals. If
you enable both ports then output goes to the UART until the first input on SPI.
When both the UART and SPI ports are enabled on power-up, all serial data goes out the UART. As
soon as input occurs on either port, that port is selected as the active port and no input or output is
allowed on the other port until the next device reset.
If you change the configuration so that only one port is configured, then that port is the only one
enabled or used. If the parameters are written with only one port enabled, then the port that is not
enabled is not used even temporarily after the next reset.