11.1.3 Interfacing in SPI Mode
Six FLEXCOM interfaces configured in Serial Peripheral Interface (SPI) mode are available on the SAM9X75 SOM Series.
The SPI circuit is a synchronous serial data link that provides communication with external devices in Host or Client mode. It also enables communication between processors if an external processor is connected to the system.
The Serial Peripheral Interface is essentially a shift register that serially transmits data bits to other SPI devices. During a data transfer, one SPI system acts as the “host” which controls the data flow, while the other devices act as “clients” which have data shifted in and out by the host. Different CPUs can take turn being hosts (multiple host protocol, as opposed to single host protocol where one CPU is always the host while all others are always clients). One host can simultaneously shift data into multiple clients. However, only one client can drive its output to write data back to the host at any given time.
A client device is selected when the host asserts its NSS signal. When multiple client devices are available, the host generates a separate client select signal (NPCS) for each.
The SPI system consists of two data lines and two control lines:
- Host Out Client In (MOSI)—This data line supplies the output data from the host shifted into the input(s) of the client(s).
- Host In Client Out (MISO)—This data line supplies the output data from a client to the input of the host. There may be no more than one client transmitting data during any particular transfer.
- Serial Clock (SPCK)—This control line is driven by the host and regulates the flow of the data bits. The host can transmit data at a variety of baud rates; there is one SPCK pulse for each bit transmitted.
- Client Select (NSS)—This control line enables turning clients on and off by hardware.
Interface Instance | IO set | Pin No. | PIO | Pin Name | Description |
---|---|---|---|---|---|
FLEXCOM0 | 1 | 138 | PA30 | FLEXCOM0_IO0 | MOSI Signal |
136 | PA31 | FLEXCOM0_IO1 | MISO Signal | ||
15 | PA8 | FLEXCOM0_IO2 | SPCK Signal | ||
10 | PA7 | FLEXCOM0_IO3 | NPCS0 Signal | ||
11 | PA6 | FLEXCOM0_IO4 | NPCS1 Signal | ||
FLEXCOM1 | 1 | 139 | PA28 | FLEXCOM1_IO0 | MOSI Signal |
141 | PA29 | FLEXCOM1_IO1 | MISO Signal | ||
70 | PC28 | FLEXCOM1_IO2 | SPCK Signal | ||
53 | PC27 | FLEXCOM1_IO3 | NPCS0 Signal | ||
67 | PC26 | FLEXCOM1_IO4 | NPCS1 Signal | ||
57 | PC17 | FLEXCOM1_IO7 | NPCS4 Signal | ||
FLEXCOM3 | 1 | 66 | PC22 | FLEXCOM3_IO0 | MOSI Signal |
51 | PC23 | FLEXCOM3_IO1 | MISO Signal | ||
67 | PC26 | FLEXCOM3_IO2 | SPCK Signal | ||
61 | PC25 | FLEXCOM3_IO3 | NPCS0 Signal | ||
69 | PC24 | FLEXCOM3_IO4 | NPCS1 Signal | ||
68 | PC30 | FLEXCOM3_IO7 | NPCS4 Signal | ||
FLEXCOM4 | 1 | 12 | PA10 | FLEXCOM4_IO0 | MOSI Signal |
13 | PA9 | FLEXCOM4_IO1 | MISO Signal | ||
14 | PA11 | FLEXCOM4_IO2 | SPCK Signal | ||
165 | PA13 | FLEXCOM4_IO4 | NPCS1 Signal | ||
154 | PA14 | FLEXCOM4_IO5 | NPCS2 Signal | ||
FLEXCOM4 | 2 | 12 | PA10 | FLEXCOM4_IO0 | MOSI Signal |
13 | PA9 | FLEXCOM4_IO1 | MISO Signal | ||
14 | PA11 | FLEXCOM4_IO2 | SPCK Signal | ||
138 | PA30 | FLEXCOM4_IO4 | NPCS1 Signal | ||
136 | PA31 | FLEXCOM4_IO5 | NPCS2 Signal | ||
FLEXCOM5 | 1 | 160 | PA16 | FLEXCOM5_IO0 | MOSI Signal |
162 | PA15 | FLEXCOM5_IO1 | MISO Signal | ||
171 | PA17 | FLEXCOM5_IO2 | SPCK Signal | ||
154 | PA14 | FLEXCOM5_IO3 | NPCS0 Signal | ||
FLEXCOM5 | 2 | 160 | PA16 | FLEXCOM5_IO0 | MOSI Signal |
162 | PA15 | FLEXCOM5_IO1 | MISO Signal | ||
171 | PA17 | FLEXCOM5_IO2 | SPCK Signal | ||
154 | PA14 | FLEXCOM5_IO3 | NPCS0 Signal | ||
138 | PA30 | FLEXCOM5_IO4 | NPCS1 Signal |