cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L471RGT6 32 bit SPI

rwils.1
Associate III

Hi is it possible to communicate 32 bit data over the SPI bus? Using IOC to set up the SPI port 2 , I seem to be limited to 16 bits.

Thanks a lot 

 

Richard

 

 

5 REPLIES 5

As a pair of 16-bit words, or as 4-bytes, in a consecutive fashion, and arranged to suit whatever MSB-LSB and endian form you need.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Pavel A.
Evangelist III

Of course. Send 16-bits, twice. Newer STM32s can send 32 bits in one write to the SPI data register, but L4 is limited to 16 bits at once.

 

rwils.1
Associate III

Thank you Pavel, I was going to use NSS but I was thinking that that won't work as comms will shutdown after the first 16 bytes. I guess I will just have to manually control NSS. 
Cheers

Richard

 

 

You pretty much always have to manually control NSS, as it's gated by the SPI Enable, not by individual words or byte transacted via the data register. Most just use a GPIO as it's less trouble.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks for the information!