MAX32660 User Guide
Maxim Integrated Page 162 of 195
13.3.1 Pin Configuration
Pin selection and configuration is required to use the SPI port. Table 13-3 shows the pin selection options for each of the SPI
ports for each package available. The Alternate Function Name column maps the typical SPI Signal name to the Alternate
Function name on the MAX32660 family of parts. The required pins for SPI0 are all mapped to Alternate Function 1 on GPIO
Port 0 and are available on the same pins in both the 16-WLP and the 20-TQFN as shown in Table 13-3.
Table 13-3: SPI0 Pins
Four-wire SPI uses SCK, MISO, MOSI, and the SS pin, whereas three-wire SPI uses SCK, MOSI(SISO) and the SS pin. The
following steps outline setting up the GPIO0 pins for the SPI alternate function usage for SPI0.
1. Set the GPIO pin for alternate function operation.
a. SPI0_SCK: Set GPIO0_EN[6] to 0.
b. SPI0_MOSI (SISO): Set GPIO0_EN[5] to 0.
c. SPI0_MISO: Set GPIO0_EN[4] to 0.
i. If using three-wire SPI this step is not required.
d. SPI0_SS0: Set GPIO0_EN[7] to 0.
2. Select AF1 using the GPIO0_AF_SEL register.
a. SPI0_SCK: Set GPIO0_AF_SEL[6] to 0
b. SPI0_MOSI: Set GPIO0_AF_SEL[5] to 0.
c. SPI0_MISO: Set GPIO0_AF_SEL[4] to 0.
i. If using three-wire SPI this step is not required.
d. SPI0_SS0: Set GPIO0_AF_SEL[7] to 0.
13.3.2 Master Configuration
For SPI Master operation, set the master enable bit to 1 (SPI0_CTRL0.mm_en = 1).
In a single master network the slave select pin operates as an output only. Configure the slave select pin as an output by
setting SPI0_CTRL0.ss_io to 1. Additionally, prior to starting a SPI Master mode transaction, set the Slave Select Enable bit to
1 (SPI0_CTRL0.ss_sel = 1) to use the SPI0_SS0 pin as the slave select output.
13.3.3 Slave Configuration
For slave operation, set the master enable bit to 0 (SPI0_CTRL0.mm_en = 0). In slave mode, the slave select pin is used for
to indicate that the SPI Master is starting a communication with the SPI Slave. Set the slave select pin as an input by setting
SPI0_CTRL0.ss_io to 0.