User Manual
Bluegiga Proprietary Version 1.0
22
11 SERIAL PERIPHERAL INTERFACE
WRAP THOR 2022-1 uses 16-bit data and 16-bit address during serial peripheral interface
transactions. Such transactions will occur whether the internal processor is running or is stopped.
This section details the
considerations required when interfacing to WRAP THOR 2022-1 via the four dedicated serial
peripheral interface terminals. Data may be written or read one word at a time or the auto-increment
feature may be used to access blocks.
11.1 I
NSTRUCTION CYCLE
Before WRAP THOR 2022-1 can be addressed, SPI_CSB must be taken low (SPI_CSB = 0).
Data on SPI_MOSI is then clocked into WRAP THOR 2022-1 on the rising edge of the clock line
SPI_CLK.
When reading, WRAP THOR 2022-1 will reply to the Master on MISO (the data being valid on the
falling edge of the SPI_CLK). The Master provides the clocking.
11.2 S
INGLE-CYCLE OPERATION
After a serial peripheral interface transaction completes, the Master toggles SPI_CLK with
SPI_CSB high to
initiate a new transaction. SPI_CSB must be high for at least two SPI_CLK cycles.
11.3 M
ULTI-SLAVE OPERATION
WRAP THOR 2022-1 should not be connected in a multi-slave arrangement by simple parallel
connection of slave MISO lines. When WRAP THOR 2022-1 is deselected (SPI_CSB = 1), the
SPI_MISO line does not float
. Instead, WRAP THOR 2022-1 outputs 0 if the processor is running
or 1 if it is stopped.
11.4 W
RITING TO
WRAP THOR 2022-1
To write to WRAP THOR 2022-1, the 8-bit write command (00000010) is sent first (C[7:0])
followed by a 16-bit address (A[15:0]). After that, 16-bits of data (D[15:0]) are sent.
11.5 A
UTO-INCREMENT OPERATION
Sending a command word and the address of a register every time it is to be read or written can be a
significant overhead, especially when large amounts of data are to be transferred. To overcome this
WRAP THOR 2022-1 offers increased data transfer efficiency via an auto-increment operation.
During operation, WRAP THOR 2022-1 increments the address automatically. Only the data is
transmitted or received over the serial peripheral interface. WRAP THOR 2022-1 keeps the
previous command word.
Auto-increment mode is invoked by keeping SPI_CSB low after the last bit of a read or write
operation, while providing an extra 16 clock cycles. If the previous command was a write,
continuous 16-bit words of data may then be written to the WRAP THOR 2022-1 without the need
to send the address or command word. Similarly, if the previous command was a read, then data
may be read. T[15:0] are not returned after the first read, just D[15:0].