SPI communications
The XBee/XBee-PRO Zigbee RF Module supports SPI communications in slave mode. Slave mode receives the clock signal and data from the master and returns data to the master. The following table shows the signals that the SPI port uses on the device.
Signal | Function |
---|---|
SPI_MOSI (Master Out, Slave In) | Inputs serial data from the master |
SPI_MISO (Master In, Slave Out) |
Outputs serial data to the master |
SPI_SCLK (Serial Clock) |
Clocks data transfers on MOSI and MISO |
SPI_SSEL (Slave Select) |
Enables serial communication with the slave |
The preceding four pins are standard for SPI. This devicd 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 device. SPI_ATTN asserts whenever it has data to send, and it remains asserted until all available data has been shifted out to the SPImaster.
In this mode:
-
Data/clock rates of up to 5 Mb/s are possible.
- Data is most significant bit (MSB) first.
- Frame Format mode 0 is used. This means CPOL= 0 (idle clock is low) and CPHA = 0 (data is sampled on the clock’s leading edge).
- The SPI port only supports API Mode (AP = 1).
The following diagram shows the frame format mode 0 for SPI communications.