Skip to main content
LOVEKUSH PRATAP
Associate II
December 7, 2018
Question

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

  • December 7, 2018
  • 1 reply
  • 715 views

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

This topic has been closed for replies.

1 reply

Uwe Bonnes
Chief
December 7, 2018

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.