AnsweredAssumed Answered

STM32F051R8 SPIx->DR data in high byte

Question asked by Richard on Dec 1, 2015
I have set the data size to 8 bits for SPI on SPI1 using the pins PB3,4,5, PA15.
I see 8 bits of data on the MOSI line corresponding to the 8 bits I put into SPI1-DR. But on the rx side I see the 8 rx bits in SPI-DR [15:8] followed by 0 in [7:0].

I have altered my library call to read all 16 bits and then right shift to get the 8 bits in the MSB byte and return it as the read data.

But according to the documentation that should be WRONG.

Here are the SPI registers just before I pop the value from DR.
SPI1->CR1= 0x35C
SPI1->CR2=0x1704
SPI1->SR = 0x203

I am at a loss to explain it.

Outcomes