STM32F302: SPI data register not changing on write for certain modes
Hi,
While using the SPI2 for transmitting a data in STM32F302R8, the transmitting data reflects in the DATA register only in the CPOL = 0(Low) and CPHA = 0(1st edge). In the other modes (CPOL and CPHA) the data is not reflecting in the DATA register.
My configurations:
Mode: Full-Duplex Master
Basic Parameters:
Frame Format: Motorola
Data Size: 8 Bits
First Bit: MSB first
Clock Parameters:
Prescaler (for Baud Rate):2
Baud Rate: 16.0 MBits/s
Clock Polarity (CPOL): High
Clock Phase (CPHA): 2 Edge
Advanced Parameters
CRC Calculation: Disabled
NSS Signal Type: Output Hardware (I tried for both Output Hardware and NSS signal type: Disable)
What might be problem with my configurations?
Here are my observations:
# | CPOL | CPHA | Status in DATA register |
Mode 1 | Low | Edge 1 | Data reflected correctly |
Mode 2 | Low | Edge 2 | Wrong data reflected |
Mode 3 | High | Edge 1 | No data reflected |
Mode 4 | High | Edge 2 | No data reflected |
Also, it is not mentioned in the errata either.
Has anyone faced this? Kindly help me with this.
Best regards,
Sanjay
