
GR716-DS-UM, May 2019, Version 1.29
429
www.cobham.com/gaisler
GR716
43.2
Transmission protocol
The SPI bus is a full-duplex synchronous serial bus. Transmission starts when a master selects a slave
through the slave’s Slave Select (SEL) signal and the clock line SCK transitions from its idle state.
Data is transferred from the master through the Master-Output-Slave-Input (MOSI) signal and from
the slave through the Master-Input-Slave-Output (MISO) signal. In some systems with only one mas-
ter and one slave, the Slave Select input of the slave may be always active and the master does not
need to have a slave select output. This does not apply to this SPI to AHB bridge, the slave select sig-
nal must be used to mark the start and end of an operation.
During a transmission on the SPI bus data is either changed or read at a transition of SCK. If data has
been read at edge n, data is changed at edge n+1. If data is read at the first transition of SCK the bus is
said to have clock phase 0, and if data is changed at the first transition of SCK the bus has clock phase
1. The idle state of SCK may be either high or low. If the idle state of SCK is low, the bus has clock
polarity 0 and if the idle state is high the clock polarity is 1. The combined values of clock polarity
(CPOL) and clock phase (CPHA) determine the mode of the SPI bus. Figure 71 shows one byte
(0x55) being transferred MSb first over the SPI bus under the four different modes. Note that the idle
state of the MOSI line is ‘1’ and that CPHA = 0 means that the devices must have data ready before
the first transition of SCK. The figure does not include the MISO signal, the behavior of this line is
the same as for the MOSI signal. However, due to synchronization the MISO signal will be delayed
for a period of time that depends on the system clock frequency.
The SPI to AHB bridge makes use of a protocol commonly used by SPI Flash memory devices. A
master first selects the slave via the slave select signal and then issues a one-byte instruction. The
instruction is then followed by additional bytes that contain address or data values. All instructions,
addresses and data are transmitted with the most significant bit first. All AMBA accesses are done in
big endian format. The first byte sent to or from the slave is the most significant byte.
Figure 70.
SPI to AHB bridge block diagram
A
M
B
A
A
H
B
Shift register
SPI2AHB
SCK
MISO
Control
FSM
SCK (filtered)
MOSI (filtered)
Fi
lter
MOSI
SEL
Figure 71.
SPI transfer of byte 0x55 in all modes
SCK
MOSI