cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H563 DSIZE makes no difference to number of SPI clocks (SPI2)

DiBosco
Senior

Folks,

I've used SPI many times on STM32F1, F0, F4 devices, but am have a mare with a H563. I have two 74HC165s reading sixteen switches.

For hours and hours I couldn't get any clock out when I executed:

SPI2->TXDR = 0;

Eventually I tried setting the CSTART bit in the CR1 register (I really can't get my head round what the manual is trying to say for this bit, it's incredibly poorly written) and that then sprung the clock in to life for a burst of clock activity when I wrote 0 to the transmit register.

However, no matter what value is in DSIZE in the CFG1 register I always get 32 bit clocks sent out.

I am getting a sixteen bit value in the RX register, not a thirty-two-bit value though.

So, for example, if I set the switch that corresponds to the fourth data bit in the stream, I get the thirty-two clocks, but I get a value of 0x1000 in the RX register of the SPI peripheral. If I set the number of clocks in the DSIZE portion of CFG1 to thirty-two bits then I get 0x10000000 in the Rx register.

So, what on earth is going on with the SPI CLK on the SCLK pin here? Why is DSIZE making no difference to number of clocks? I'm assuming there's something fundamental I'm not understanding with this SPI peripheral on the H563, it does seem a load more complicated  that previous SPI peripherals I've used.

 

Thanks!

0 REPLIES 0