cancel
Showing results for 
Search instead for 
Did you mean: 

Do any STM32 devices support 20-bit SPI?

SoCalJim
Associate II
 
10 REPLIES 10
AScha.3
Chief III

H7 series, like H743, has SPI with data size 4....32 bit frame.

If you feel a post has answered your question, please click "Accept as Solution".

This says 4-16 bit frames. Are bigger frames available in software?

 

SoCalJim_1-1737066629952.png

 

 

Separate between "word size" and "frame size".
SPI can support "word size" as 4, 8, ... bits per word (up to 32bit).

So, 20bit as "word size" should be possible. If not directly, consider it as sending a 16bit word plus a 4bit word.

"Frame Size" is independent of it: if you can send any "word" (as 20bit) - any number of words can be transmitted (limitation is potentially on a 64K word size boundary, e.g. due to DMA addresses).

Any "frame size" is possible in SW.

Thanks! My challenge is that I'm slave and don't control the clock. I should have made that clear. I'm listening to 20 consecutive clocks.

Sure,

but still options to prepare and test:

  • generate your own Master SPI to send 20bit words
  • connect your "test Master" with your Slave: MOSI - MOSI
  • check if you can receive what you send

Check if your Slave device is enabled, has the right internal clock configuration for the Slave...

(I think, you have another thread open related to this topic - see also there)

To be honest: "what is your issue?" (how to receive 20bit words? ... generate 20bit words and try to receive it...)

If you create a "test master" able to send 20bit words - than a SPI Slave should be possible also for receiving 20bit words. And you can test your Slave with your "test master".

Have you digest the datasheet for the question "why a 20bit SPI word size" should not be possible?"

Not every SPI can use 20b format...see rm :

 

AScha3_1-1737100451737.png

 

 

AScha3_0-1737100340913.png

 

If you feel a post has answered your question, please click "Accept as Solution".
gbm
Lead III

If an MCU supports 10-bit frames, 20-bit data may be sent/received as 2 10-bit frames.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice

Whoa, what document is that from?