Select The Spi Port - Digi XBee 3 Cellular LTE-M User Manual

Smart modem
Table of Contents

Advertisement

SPI operation
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 17) 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.
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.

Select the SPI port

To force SPI mode, hold DOUT/DIO13 pin 2 low while resetting the device until SPI_ATTN asserts. This
causes the device to disable the UART and go straight into SPI communication mode. Once
configuration is complete, the device queues a modem status frame to the SPI port, which causes the
SPI_ATTN line to assert. The host can use this to determine that the SPI port is configured properly.
This method forces the configuration to provide full SPI support for the following parameters:
D1 (This parameter will only be changed if it is at a default of zero when the method is
n
invoked.)
D2
n
D3
n
D4
n
P2
n
As long as the host does not issue a WR command, these configuration values revert to previous
values after a power-on reset. If the host issues a WR command while in SPI mode, these same
parameters are written to flash. After a reset, parameters that were forced and then written to flash
become the mode of operation.
If the UART is disabled and the SPI is enabled in the written configuration, then the device comes up in
SPI mode without forcing it by holding DOUT low. If both the UART and the SPI are enabled at the time
of reset, then output goes to the UART until the host sends the first input. If that first input comes on
the SPI port, then all subsequent output goes to the SPI port and the UART is disabled. If the first
input comes on the UART, then all subsequent output goes to the UART and the SPI is disabled.
Once you select a serial port (UART or SPI), all subsequent output goes to that port, even if you apply a
new configuration. The only way to switch the selected serial port is to reset the device. On surface-
mount devices, forcing DOUT low at the time of reset has no effect. To use SPI mode on the SMT
devices, assert the SPI_SSEL (pin 17) low after reset and before any UART data is input.
When the master asserts the slave select (SPI_SSEL) signal, 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 rising edge
Digi XBee® 3 Cellular LTE-M/NB-IoT Global Smart Modem User Guide
Select the SPI port
152

Advertisement

Table of Contents
loading

This manual is also suitable for:

Xbee 3 cellular nb-iot

Table of Contents