11.1.3 Interfacing in SPI Mode

Four FLEXCOM interfaces configured in SPI mode are available on the SAM9X60D1G-I/LZB.

The Serial Peripheral Interface (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 turns 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 allows clients to be turned on and off by hardware.
Table 11-3. FLEXCOM Interface Configurations in SPI Mode
Interface InstanceIO SetPin No.PIOPin NameDescription
FLEXCOM1173PA5FLEXCOM1_IO0MOSI Signal
74PA6FLEXCOM1_IO1MISO Signal
129PC29FLEXCOM1_IO2SPCK Signal
128PC28FLEXCOM1_IO3NPCS0 Signal
FLEXCOM31120PC22FLEXCOM3_IO0MOSI Signal
121PC23FLEXCOM3_IO1MISO Signal
126PC26FLEXCOM3_IO2SPCK Signal
125PC25FLEXCOM3_IO3NPCS0 Signal
FLEXCOM41145PA12FLEXCOM4_IO0MOSI Signal
144PA11FLEXCOM4_IO1MISO Signal
146PA13FLEXCOM4_IO2SPCK Signal
147PA14FLEXCOM4_IO3NPCS0 Signal
FLEXCOM42145PA12FLEXCOM4_IO0MOSI Signal
144PA11FLEXCOM4_IO1MISO Signal
146PA13FLEXCOM4_IO2SPCK Signal
147PA14FLEXCOM4_IO3NPCS0 Signal
FLEXCOM5135PA22FLEXCOM5_IO0MOSI Signal
36PA21FLEXCOM5_IO1MISO Signal
34PA23FLEXCOM5_IO2SPCK Signal
33PA8FLEXCOM5_IO3NPCS0 Signal
80PA31FLEXCOM5_IO5NPCS2 Signal
79PA30FLEXCOM5_IO6NPCS3 Signal
FLEXCOM5235PA22FLEXCOM5_IO0MOSI Signal
36PA21FLEXCOM5_IO1MISO Signal
34PA23FLEXCOM5_IO2SPCK Signal
33PA8FLEXCOM5_IO3NPCS0 Signal
32PA7FLEXCOM5_IO4NPCS1 Signal
80PA31FLEXCOM5_IO5NPCS2 Signal
79PA30FLEXCOM5_IO6NPCS3 Signal