cancel
Showing results for 
Search instead for 
Did you mean: 

How to increase SPI data size of STM32F107 to 24 bit ?

LOVEKUSH PRATAP
Associate II

I'm working on STM32F107 microcontroller standard library and interfacing external ADC through SPI.

In SPI configuration , there are two data size, 8 bit and 16 bit as in below lines - 

#define SPI_DataSize_16b        ((uint16_t)0x0800)

#define SPI_DataSize_8b        ((uint16_t)0x0000)

#define IS_SPI_DATASIZE(DATASIZE) (((DATASIZE) == SPI_DataSize_16b) || \

                  ((DATASIZE) == SPI_DataSize_8b))

So how can I configure 24 data size?

please share the code

1 REPLY 1
Uwe Bonnes
Principal III

You can not. Either do 3 byte or one half-woard and one byte transaction. You couls also set up a DMA transfer of 3 bytes.