Configuration Considerations; Spi And Api Mode; Spi Parameters; Serial Port Selection - Digi XBee SX User Manual

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

Advertisement

Serial communication
It has the disadvantage of putting the device to sleep whenever the SPI master negates SPI_SSEL
(meaning time is lost waiting for the device to wake), even if that was not the intent.
If the user has full control of SPI_SSEL so that it can control pin sleep, whether or not data needs to be
transmitted, then sharing the pin may be a good option in order to make the SLEEP_REQUEST pin
available for another purpose.
If the device is one of multiple slaves on the SPI, then the device sleeps while the SPI master talks to
the other slave, but this is acceptable in most cases.
If you do not configure either pin as a peripheral, then the device stays awake, being unable to sleep in
SM1 mode.

Configuration considerations

The configuration considerations are:
How do you select the serial port? For example, should you use the UART or the SPI port?
n
If you use the SPI port, what data format should you use in order to avoid processing invalid
n
characters while transmitting?
What SPI options do you need to configure?
n

SPI and API mode

The SPI only operates in API mode 1. The SPI does not support Transparent mode or API mode 2 (with
escaped characters). This means that the AP configuration only applies to the UART interface and is
ignored while using the 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/XBee-PRO SX 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/XBee-PRO SX 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 port selection

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.
XBee®/XBee-PRO SX RF Module User Guide
Configuration considerations
62

Advertisement

Table of Contents
loading

This manual is also suitable for:

Xbee-pro sx

Table of Contents