Data Format; Spi Parameters; Serial Buffers; Serial Receive Buffer - Digi XBee SX 868 User Manual

Radio frequency (rf) module
Hide thumbs Also See for XBee SX 868:
Table of Contents

Advertisement

Operation
If you enable only the UART, the XBee SX 868 RF Module uses only the UART, and ignores the SPI_
SSEL.
If you enable only the SPI, the XBee SX 868 RF Module uses only the SPI, and ignores UART
communications.

Data format

SPI only operates in API mode 1. The XBee SX 868 RF Module does not support Transparent mode or
API mode 2 (which escapes control characters). This means that the AP configuration only applies to
the UART, and the device ignores it while using SPI.

SPI parameters

Most host processors with SPI hardware allow you to set the bit order, clock phase and polarity. For
communication with all XBee SX 868 RF Modules, the host processor must set these options as
follows:
Bit order: send MSB first
n
Clock phase (CPHA): sample data on first (leading) edge
n
Clock polarity (CPOL): first (leading) edge rises
n
All XBee SX 868 RF Modules use SPI mode 0 and MSB first. Mode 0 means that data is sampled on the
leading edge and that the leading edge rises. MSB first means that bit 7 is the first bit of a byte sent
over the interface.

Serial buffers

To enable the UART port, DIN and DOUT must be configured as peripherals. To enable the SPI port,
SPI_MISO, SPI_MOSI, SPI_SSEL, and SPI_CLK must be enabled as peripherals. If both ports are
enabled, output goes to the UART until the first input on SPI. This is the default configuration.
When 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 reset of the module.
If you change the configuration to configure only one port, that port is the only one enabled or used. If
the parameters are written with only one port enabled, the port that is not enabled is not used even
temporarily after the next reset.
If both ports are disabled on reset, the device uses the UART regardless of the incorrect configuration
to ensure that at least one serial port is operational.

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.
If the SPI is the serial port, no hardware flow control is available. It is your responsibility to ensure
that the receive buffer does not overflow. One reliable strategy is to wait for a TX_STATUS response
after each frame sent to ensure that the device has had time to process it.
XBee® SX 868 RF Module User Guide
Serial buffers
56

Advertisement

Table of Contents
loading

Table of Contents