XBee®/XBee‐PRO® ZB SMT RF Modules
• SPI_SSEL (Slave Select) - enables serial communication with the slave
The above four pins are standard for SPI. This module also supports an additional pin, which may be configured
to alert the SPI master when it has data to send. This pin is called SPI_ATTN. If the master monitors this pin
(through polling or interrupts), it can know when it needs to receive data from the module. SPI_ATTN asserts
whenever it has data to send and it remains asserted until all available data has been shifted out to the SPI
master.
In this mode, the following apply:
• Data/Clock rates of up to 5 Mbps are possible
• Data is MSB first
• Frame Format mode 0 is used (see below)
Frame Format for SPI Communications
SPI Operation
When the slave select (SPI_SSEL) signal is asserted by the master, SPI transmit data is driven to the output pin
(SPI_MISO), and SPI data is received from the input pin SPI_MOSI. The SPI_SSEL pin has to be asserted to
enable the transmit serializer to drive data to the output signal SPI_MISO. A falling edge on SPI_SSEL resets
the SPI slave shift registers.
If the SPI_SCLK is present, the SPI_MISO line is always driven whether with or without the SPI_SSEL line
driven. This is a known issue with the Ember EM357 chip, and makes additional hardware necessary if multiple
slaves are using the same bus as the XBee.
If the input buffer is empty, the SPI serializer transmits a busy token (0xFF). Otherwise, all transactions on the
SPI port use API operation. See Chapter 9 - API Operation for more information.
The SPI slave controller must guarantee that there is time to move new transmit data from the transmit buffer
into the hardware serializer. To provide sufficient time, the SPI slave controller inserts a byte of padding at the
start of every new string of transmit data. Whenever the transmit buffer is empty and data is placed into the
transmit buffer, the SPI hardware inserts a byte of padding onto the front of the transmission as if this byte
were placed there by software.
Serial Port Selection
In the default configuration the UART and SPI ports will both be configured for serial port operation.
If both interfaces are configured, serial data will go out the UART until the SPI_SSEL signal is asserted.
Thereafter, all serial communications will operate on the SPI interface.
If only the UART is enabled, then only the UART will be used, and SPI_SSEL will be ignored. If only the SPI is
enabled, then only the SPI will be used.
If neither serial port is enabled, the module will not support serial operations and all communications must
occur over the air. All data that would normally go to the serial port is discarded.
Serial Buffers
The XBee modules maintain small buffers to collect received serial and RF data, which is illustrated in the figure
below. The serial receive buffer collects incoming serial characters and holds them until they can be processed.
© 2010 Digi International, Inc.
26