DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10316_0
© NXP B.V. 2008. All rights reserved.
User manual
Rev. 00.06 — 17 December 2008
257 of 571
NXP Semiconductors
UM10316
Chapter 18: LPC29xx SPI0/1/2
In normal transmission mode software programs the settings of the SPI module, writes
data to the transmit FIFO and then enables the SPI module. The SPI module transmits
until all data has been sent, or until it gets disabled with data still unsent. When data
needs to be transmitted to another slave software has to re-program the settings of the
SPI module, write new data and enable the SPI module again.
Remark:
When reprogramming any of its settings the SPI module needs to be disabled
first, then enabled again after changing the settings. Transmit data can also be added
when the SPI module is still enabled: disabling is not necessary in this case.
Sequential-slave mode
This mode reduces software intervention and interrupt load.
In this mode it is possible to sequentially transmit data to different slaves without having to
reprogram the SPI module between transfers. The purpose of this is to minimize
interrupts, software intervention and bus traffic. This mode is only applicable when the SPI
module is in master mode.
In the example in
the SPI module supports addressing of four slaves, all of
which are sent data in sequential-slave mode. Three elements are transferred to slave 1,
two to slave 2, three to slave 3 and finally one to slave 4, after which the SPI module
disables itself. When it gets enabled again the same data is transmitted to the four slaves.
Before entering this mode the transmit data needs to be present in the transmit FIFO. No
data may be added after entering sequential-slave mode. When the data to be transferred
needs to be changed the transmit FIFO needs to be flushed and sequential-slave mode
has to be left and entered again to take over the new data present in the transmit FIFO.
This is necessary because the FIFO contents are saved as a side-effect of entering
sequential-slave mode from normal transmission mode. The data in the transmit FIFO will
be saved to allow transmitting it repeatedly without the need to refill the FIFO with the
same data.
All programming of the settings necessary to adapt to all slaves has to be done before
enabling (starting the transfer) the SPI module in sequential-slave mode. Once a transfer
has started these settings cannot be changed until the SPI module has finished the
transfer and is automatically disabled again. The use of only one slave in sequential-slave
mode is possible.
Once a sequential-slave mode transfer has started it will complete even if the SPI module
is disabled before the transfers are over. When a transfer is finished the SPI module
disables itself and request a sequential-slave mode ready interrupt.