Serial communication Full duplex operation
XBee®/XBee-PRO SX RF Module User Guide
61
Full duplex operation
When using SPI on the XBee/XBee-PRO SX RF Module the device uses API operation (AP = 1) without
escaped characters to packetize data. SPI is a full duplex protocol, even when data is only available in
one direction. This means that whenever a device receives data, it also transmits, and that data is
normally invalid. Likewise, whenever a device transmits data, invalid data is probably received. To
determine whether or not received data is invalid, the firmware places the data in API packets.
SPI allows for valid data from the slave to begin before, at the same time, or after valid data begins
from the master. When the master sends data to the slave and the slave has valid data to send in the
middle of receiving data from the master, a full duplex operation occurs, where data is valid in both
directions for a period of time. Not only must the master and the slave both be able to keep up with
the full duplex operation, but both sides must honor the protocol.
The following figure illustrates the SPI interface while valid data is being sent in both directions.
Low power operation
Sleep modes generally work the same on SPI as they do on UART. By default, Digi configures DIO8
(SLEEP_REQUEST) as a peripheral and during pin sleep it wakes the device and puts it to sleep. This
applies to both the UART and SPI serial interfaces.
If SLEEP_REQUEST is not configured as a peripheral and SPI_SSEL is configured as a peripheral, then
pin sleep is controlled by SPI_SSEL rather than by SLEEP_REQUEST. Asserting SPI_SSEL (pin 15) by
driving it low either wakes the device or keeps it awake. Negating SPI_SSEL by driving it high puts the
device to sleep.
Using SPI_SSEL to control sleep and to indicate that the SPI master has selected a particular slave
device has the advantage of requiring one less physical pin connection to implement pin sleep on SPI.