Skip to main content
Kim Lui
Visitor II
September 30, 2017
Question

STM32F070CB 9Bit SPI

  • September 30, 2017
  • 2 replies
  • 1225 views
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
This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
October 1, 2017
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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
al al
Visitor II
December 6, 2017
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