30.6.1 Control A

Name: CTRLA
Offset: 0x00
Reset: 0x00000000
Property: PAC Write-Protection, Enable-Protected, Write-Synchronized

Bit 3130292827262524 
  DORDCPOLCPHAFORM[3:0] 
Access R/WR/WR/WR/WR/WR/WR/W 
Reset 0000000 
Bit 2322212019181716 
   DIPO[1:0]  DOPO[1:0] 
Access R/WR/WR/WR/W 
Reset 0000 
Bit 15141312111098 
        IBON 
Access R/W 
Reset 0 
Bit 76543210 
 RUNSTDBY  MODE[2:0]ENABLESWRST 
Access R/WR/WR/WR/WR/WR/W 
Reset 000000 

Bit 30 – DORD Data Order

This bit selects the data order when a character is shifted out from the shift register.

Note: This bit is enable-protected. This bit is not synchronized.
ValueNameDescription
0MSBMSb is transferred first
1LSBLSb is transferred first

Bit 29 – CPOL Clock Polarity

In combination with the Clock Phase bit (CPHA), this bit determines the SPI transfer mode.

Note: This bit is enable-protected. This bit is not synchronized.
ValueNameDescription
0IDLE_LOWSCK is low when IDLE. The leading edge of a clock cycle is a rising edge, while the trailing edge is a falling edge.
1IDLE_HIGHSCK is high when IDLE. The leading edge of a clock cycle is a falling edge, while the trailing edge is a rising edge.

Bit 28 – CPHA Clock Phase

In combination with the Clock Polarity bit (CPOL), this bit determines the SPI transfer mode.

Note: This bit is enable-protected. This bit is not synchronized.
ValueNameDescription
0LEADING_EDGEThe data is sampled on a leading SCK edge and changed on a trailing SCK edge
1TRAILING_EDGEThe data is sampled on a trailing SCK edge and changed on a leading SCK edge

Bits 27:24 – FORM[3:0] Frame Format

This bit field selects the various frame formats supported by the SPI in Client mode. When the SPI_FRAME_WITH_ADDR format is selected, the first byte received is checked against the ADDR register.

Note: This bit field is enable-protected. This bit field is not synchronized.
ValueNameDescription
0x0SPI_FRAMESPI Frame
0x2SPI_FRAME_WITH_ADDRSPI Frame with Address

Bits 21:20 – DIPO[1:0] Data In Pinout

These bits define the data in (DI) pad configurations.

In host operation, DI is MISO.

In client operation, DI is MOSI.

Note: This bit field is enable-protected. This bit field is not synchronized.
ValueNameDescription
0x0MUX0SERCOM PAD[0] is used as data input
0x1MUX1SERCOM PAD[1] is used as data input
0x2MUX2SERCOM PAD[2] is used as data input
0x3MUX3SERCOM PAD[3] is used as data input

Bits 17:16 – DOPO[1:0] Data Out Pinout

This bit defines the available pad configurations for data out (DO), the serial clock (SCK) and the SPI select (SS).

In host operation, DO is MOSI.

In client operation, DO is MISO.

Note:
  • This bit field is enable-protected. This bit field is not synchronized.
  • In host operation, the SPI select line (SS) is only controlled by DOPO when CTRLB.MSSEN is set to ’1’.
ValueNameDescription
0x0MUX0PAD[0]=DO, PAD[1]=SCK, PAD[2]=SS
0x1MUX1PAD[2]=DO, PAD[3]=SCK, PAD[1]=SS
0x2MUX2PAD[3]=DO, PAD[1]=SCK, PAD[2]=SS
0x3MUX3PAD[0]=DO, PAD[3]=SCK, PAD[1]=SS

Bit 8 – IBON Immediate Buffer Overflow Notification

This bit controls when the buffer overflow status bit (STATUS.BUFOVF) is set when a buffer overflow occurs.

Note: This bit is enable-protected. This bit is not synchronized.
ValueDescription
0STATUS.BUFOVF is set when it occurs in the data stream
1STATUS.BUFOVF is set immediately upon buffer overflow

Bit 7 – RUNSTDBY Run In Standby

This bit defines the functionality in Standby sleep mode.

Note: This bit is enable-protected. This bit is not synchronized.
ValueDescription
0The SPI is disabled in Standby sleep mode. In Client mode, the SPI is disabled immediately when Standby sleep mode is entered. In Host mode, the SPI is disabled when the ongoing transaction is finished.
1The SPI is enabled in Standby sleep mode

Bits 4:2 – MODE[2:0] Operating Mode

This bit field controls the SERCOM mode.

Note: This bit field is enable-protected. This bit field is not synchronized.
ValueNameDescription
0x0USART_EXTUSART with external clock
0x1USART_INTUSART with internal clock
0x2SPI_SLAVESPI Client mode
0x3SPI_MASTERSPI Host mode
0x4I2C_SLAVEI2C Client mode
0x5I2C_MASTERI2C Host mode

Bit 1 – ENABLE Enable

Note:
  1. This bit is write-synchronized: SYNCBUSY.ENABLE must be checked to ensure the CTRLA.ENABLE synchronization is complete.
  2. This bit is not enable-protected.
ValueDescription
0The peripheral is disabled or being disabled
1The peripheral is enabled or being enabled

Bit 0 – SWRST Software Reset

Writing ‘0’ to this bit has no effect.

Writing ‘1’ to this bit resets all registers in the SERCOM, except DBGCTRL, to their initial state, and the SERCOM will be disabled.

Writing ‘1’ to CTRL.SWRST will always take precedence, meaning that all other writes in the same write-operation will be discarded. Any register write access during the ongoing reset will result in an APB error. Reading any register will return the reset value of the register.

Note:
  1. This bit is write-synchronized: SYNCBUSY.SWRST must be checked to ensure the CTRLA.SWRST synchronization is complete.
  2. This bit is not enable-protected.
ValueDescription
0There is no reset operation in progress
1The reset operation is in progress