35.6.1 Principle of Operation

The SPI is a high-speed synchronous data transfer interface It allows high-speed communication between the device and peripheral devices.

The SPI can operate as host or client. As host, the SPI initiates and controls all data transactions.

When transmitting data, the Tx Buffer register can be loaded with the next character to be transmitted during the current transmission.

When receiving, the data is transferred to the two-level receive buffer, and the receiver is ready for a new character.

The SPI transaction format is shown in SPI Transaction Format. Each transaction can contain one or more characters. The character size is configurable, and can be either 8 or 9 bits.

Figure 35-2. SPI Transaction Format

The SPI host must pull the SPI Select line (SS) of the desired client low to initiate a transaction. The host and client prepare data to send via their respective shift registers, and the host generates the serial clock on the SCK line.

Data are always shifted from host to client on the Host Output Client Input line (MOSI); data is shifted from client to host on the Host Input Client Output line (MISO).

Each time character is shifted out from the host, a character will be shifted out from the client simultaneously. To signal the end of a transaction, the host will pull the SS line high

When the SERCOM is configured for SPI operation, the SERCOM controls the direction and value of the I/O pins according to the table below.

PORT Control bit PINCFGn.DRVSTR is still effective for the SERCOM output pins.

PORT Control bit PINCFGn.PULLEN is still effective on the SERCOM input pins, but is limited to the enabling/disabling of a pull down only (it is not possible to enable/disable a pull up).

If the receiver is disabled, the data input pin can be used for other purposes. In host mode, the SPI Select line (SS) is hardware controlled when the Host SPI Select Enable bit in the Control B register (CTRLB.MSSEN) is '1'.

Table 35-3. SPI Pin Configuration
PinHost SPIClient SPI
MOSIOutputInput
MISOInputOutput
SCKOutputInput

The combined configuration of PORT, the Data In Pinout and the Data Out Pinout bit groups in the Control A register (CTRLA.DIPO and CTRLA.DOPO) define the physical position of the SPI signals in the table above.