AMY-6M - Hardware Integration Manual
UBX-17021971 – R07
Appendix
Page 53 of 57
The data output MISO functions as the data return signal from the slave to the master.
Figure 40 shows a typical block diagram for an SPI master with several slaves. Here, the SCK and MOSI data lines
are shared by all of the slaves. Also the MISO data lines are linked together and led back to the master. Only the
chip selects are separately brought to each SPI device.
S P I M a s te r
S P I S la v e
0
C
h
ip
S
e
le
c
t
M OS I
S CK
Da ta Input
M IS O
S P I S la v e
1
S P I S la v e
2
S CS
0
S CS
1
S CS
2
C
lo
c
k
D
a
ta
O
u
tp
u
t
M OS I
M OS I
M OS I
S S _ N
S S _ N
S S _ N
S CK
S CK
S CK
M IS O
M IS O
M IS O
Figure 40: Master with independent slaves
SPI allows multiple microcontrollers to be linked together. These can be configured according to single or
multiple master protocols. In the first variant the microcontroller(s) designated as slave(s) behave like a normal
peripheral device. The second variant allows for several masters and allows each microprocessor the possibility to
take the role of master and to address another microprocessor. In this case one microcontroller must
permanently provide the clock signal.
There are two SPI system errors. The first occurs if several SPI devices want to become master at the same time.
The other is a collision error that occurs for example when SPI devices work with different polarities.
Systems involving multiple microcontrollers are beyond the scope of this document.
Cascading slave peripherals is not supported.
Four I/O pin signals are associated with SPI transfers: the SCK, the MISO data line, the MOSI data line, and the
active low SCS/SS_N pin. In the unselected state the MISO lines are hi-Z and therefore inactive. The master
decides with which peripheral device it wants to communicate. The clock line SCK provides synchronization for
data communication and is brought to the device whether or not it is selected.
The majority of SPI devices provide all four of these lines. Sometimes MOSI and MISO are multiplexed, or else
one is missing. A peripheral device, which must not or cannot be configured, requires no input line but only a
data output. As soon as it gets selected it starts sending data. In some ADCs therefore the MOSI line is missing.
Some devices have no data output (e.g. LCD controllers which can be configured, but cannot send data or status
messages).
The following rules should answer the most common questions concerning these signals:
SCK:
The SCK pin is an output when the SPI is configured as a master and an input when the SPI is
configured as a slave. When the SPI is configured as a master, the SCK signal is derived from the internal bus
clock. When the master initiates a transfer, eight clock cycles are automatically generated on the SCK pin.