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.
Table 11-3. FLEXCOM Interface Configurations in SPI Mode
Interface InstanceIO setPin No.PIOPin NameDescription
FLEXCOM01138PA30FLEXCOM0_IO0MOSI Signal
136PA31FLEXCOM0_IO1MISO Signal
15PA8FLEXCOM0_IO2SPCK Signal
10PA7FLEXCOM0_IO3NPCS0 Signal
11PA6FLEXCOM0_IO4NPCS1 Signal
FLEXCOM11139PA28FLEXCOM1_IO0MOSI Signal
141PA29FLEXCOM1_IO1MISO Signal
70PC28FLEXCOM1_IO2SPCK Signal
53PC27FLEXCOM1_IO3NPCS0 Signal
67PC26FLEXCOM1_IO4NPCS1 Signal
57PC17FLEXCOM1_IO7NPCS4 Signal
FLEXCOM3166PC22FLEXCOM3_IO0MOSI Signal
51PC23FLEXCOM3_IO1MISO Signal
67PC26FLEXCOM3_IO2SPCK Signal
61PC25FLEXCOM3_IO3NPCS0 Signal
69PC24FLEXCOM3_IO4NPCS1 Signal
68PC30FLEXCOM3_IO7NPCS4 Signal
FLEXCOM4112PA10FLEXCOM4_IO0MOSI Signal
13PA9FLEXCOM4_IO1MISO Signal
14PA11FLEXCOM4_IO2SPCK Signal
165PA13FLEXCOM4_IO4NPCS1 Signal
154PA14FLEXCOM4_IO5NPCS2 Signal
FLEXCOM4212PA10FLEXCOM4_IO0MOSI Signal
13PA9FLEXCOM4_IO1MISO Signal
14PA11FLEXCOM4_IO2SPCK Signal
138PA30FLEXCOM4_IO4NPCS1 Signal
136PA31FLEXCOM4_IO5NPCS2 Signal
FLEXCOM51160PA16FLEXCOM5_IO0MOSI Signal
162PA15FLEXCOM5_IO1MISO Signal
171PA17FLEXCOM5_IO2SPCK Signal
154PA14FLEXCOM5_IO3NPCS0 Signal
FLEXCOM52160PA16FLEXCOM5_IO0MOSI Signal
162PA15FLEXCOM5_IO1MISO Signal
171PA17FLEXCOM5_IO2SPCK Signal
154PA14FLEXCOM5_IO3NPCS0 Signal
138PA30FLEXCOM5_IO4NPCS1 Signal