SPI operation
Low power operation
Digi XBee3 Cellular LTE-M/NB-IoT Global Smart Modem User Guide
140
Low power operation
Sleep modes generally work the same on SPI as they do on UART. However, due to the addition of SPI
mode, there is an option of another sleep pin, as described below.
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
SM
1 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:
n
D1
(This parameter will only be changed if it is at a default of zero when the method is
invoked.)
n
D2
n
D3
n
D4
n
P2
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.