cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F070CB 9Bit SPI

Kim Lui
Associate
Posted on September 30, 2017 at 11:02

Test Nucleo board,(SPI_FullDuplex_ComPolling) 

I tried to modify SPI example code to drive LCD,

But I have no idea how to send 9bit data ,

I found data size setting, SPI_DATASIZE_9BIT?

Clk send 9bit clock, but data all wrong,

How to correctly send data ?

#lcd #stm32 #spi #hal_spi_transmitreceive #9bit
2 REPLIES 2
Posted on October 01, 2017 at 18:58

Use functions that write to the SPI data register with 16-bit width, not 8-bit width?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
al al
Associate II
Posted on December 06, 2017 at 15:02

uint16_t TxData;

TxData = 0xFF |0x100; 

HAL_SPI_Transmit(&hspi1,(uint8_t*)&TxData,1,0x1000); //Send 0x1FF

TxData = 0xFF; 

HAL_SPI_Transmit(&hspi1,(uint8_t*)&TxData,1,0x1000); //Send 0x0FF