GD32F403xx User Manual
466
mode, and frame format should follow the normal SPI protocol, and set the data capture edge
to first clock transition.
In summary: NSSP = 1; MSTMOD = 1; CKPH = 0;
When active, a pluse duration of least 1 SCK clock priod is inserted between successive data
frames depending on internal data transmit buffer status, multiple SCK clock cycle interval is
possible if the transfer buffer stays empty. This function is designed for single master-slave
configuration for the slave to latch data. The following diagram depicts its timing diagram.
Figure 19-11. Timing diagram of NSS pulse with continuous transmit
NSS
SCK
MISO
MOSI
MSB
LSB
LSB
MSB
MSB
LSB
MSB
LSB
Don
t Care
Don
t Care
Don
t Care
1 SCK
Quad-SPI mode operation sequence
The Quad-SPI mode is designed to control quad SPI flash.
In order to enter Quad-SPI mode, the software should first verify that the TBE bit is set and
TRANS bit is cleared, then set QMOD bit in SPI_QCTL register. In Quad-SPI mode, BDEN,
BDOEN, CRCEN, CRCNT, FF16, RO and LF in SPI_CTL0 register should be kept cleared
and MSTMOD should be set to ensure that SPI is in master mode. SPIEN, PSC, CKPL and
CKPH should be configured as desired.
There are 2 operation modes in Quad-SPI mode: quad write and quad read, decided by QRD
bit in SPI_QCTL register.
Quad write operation
SPI works in quad write mode when QMOD is set and QRD is cleared in SPI_QCTL register.
In this mode, MOSI, MISO, IO2 and IO3 are all used as output pins. SPI begins to generate
clock on SCK line and transmit data on MOSI, MISO, IO2 and IO3 as soon as data is written
into SPI_DATA (TBE is cleared) and SPIEN is set. Once SPI starts transmission, it always
checks TBE status at the end of a frame and stops when condition is not met.
The operation flow for transmitting in quad mode:
1. Conf igure clock prescaler, clock polarity, phase, etc. in SPI_CTL0 and SPI_CTL1 based
on your application requirements.
2. Set QMOD bit in SPI_QCTL register and then enable SPI by setting SPIEN in SPI_CTL0.
3. Write the byte to SPI_DATA register and the TBE will be cleared.
4. Wait until TBE is set by hardware again before writing the next byte.
Содержание GD32F403 Series
Страница 1: ...GigaDevice Semiconductor Inc GD32F403xx Arm Cortex M4 32 bit MCU User Manual Revision 2 6 Jul 2022 ...
Страница 177: ...GD32F403xx UserManual 177 Peripheral Channel 0 Channel 1 Channel 2 Channel 3 Channel 4 SDIO SDIO ...
Страница 217: ...GD32F403xx UserManual 217 ensures that no conversion is in progress ...