Note: It is not recommended to use QSPICTL0->QSPIFORMAT = 0x0, which
configures QSPI to behave as legacy SPI module. If legacy SPI functionality is
needed, the user should use the SPGSS.SPI modules in M33C32. The user should not
configure and use any Legacy SPI *** registers mentioned in Section 2.11, except for
CTL0->CSSEL, SPO,SPH and CTL1->ENABLE as needed. CTL1->CP should always be 1 as QSPI
only works as a controller.
To enable and initialize the QSPI, the following steps are necessary:
- Configure the IOMUX with the
appropriate GPIO pins for which the QSPI signals are multiplexed to
Note: Pull-ups
can be used to avoid unnecessary toggles on the SPI pins, which can take the
peripheral to a wrong state. In addition, if the SCLK signal is programmed to
steady state High through the SPO bit in the CTL0 register, then software must
also configure the GPIO port pin corresponding to the SCLK signal as a
pull-up.
For each of the frame formats, the QSPI is configured using the following steps:
- Ensure that the ENABLE bit in the CTL1 register is clear before making any
configuration changes.
- Configure the clock prescale divider by writing the CLKDIV register.
- Ensure that CLKSEL always selects SYSCLK as the source
clock as QSPI does not support MFCLK and LFCLK.
- Ensure that MS bit in the CTL1 register is set as QSPI always works in
controller mode.
- Ensure that MSB bit in the CTL1 register is set to always send MSB first
when using QSPI.
- Ensure that PACKEN bit in the CTL0 register is always disabled as QSPI does
not support 32-bit data packing.
- Configure the clock divider by writing the CLKCTL register.
- Configure the QSPI registers with based on the desired frame, data width and
other special configurations.
- Optionally configure DMA.
- Enable the QSPI by setting the ENABLE bit in the CTL1 register.