4158 views|5 replies

12

Posts

0

Resources
The OP
 

3-wire spi, LCD driver for HX8369 [Copy link]

I am now working on a LCD driver for HX8369, and the CPU is STM32F429. My question is how to use 3-wire SPI (cs clk sda) to initialize the LCD. The format of the driver given to me by the manufacturer is: send the register address first, and then send the register data. Write_3Spi_cmd(0x0001); Write_3Spi_data(0x6300); Write_3Spi_cmd(0x0002); Write_3Spi_data(0x0200); Write_3Spi_cmd(0x0003); Write_3Spi_data(0x6564); ................................................................................... My question is, when using spi to send data to LCD, (there are only three lines of spi), how to distinguish whether the data is sent is address or data, how to implement it in the program? Save the children! ! ! ! ! ! ! ! ! Save the children!!!!!!!!!!!! Save the children!!!!!!!!!!!!!!!!!


This post is from stm32/stm8

Latest reply

SPI data is not 8 bits, but 9 bits. The highest bit represents command or data. For example, 0x00** represents command and 0x01** represents data.   Details Published on 2019-12-29 19:47
 

9

Posts

0

Resources
2
 
Look at the data sheet. From your description, it may be that the register address is used to identify data or commands. What you write to the control register is a command, and what you write to the display buffer register is data. It may be like this. You can also look at the differences between the write data and write command functions provided by the manufacturer, and reverse the process!
This post is from stm32/stm8
 
 

12

Posts

0

Resources
3
 
ckvlhf posted on 2019-4-4 14:24 Look at the data sheet. From your description, it seems that you rely on the register address to identify data or commands. What you write to the control register is the command, and what you write to the display...
Thank you. How do you identify which register to write to? When spi is sending, do you compare the content sent by one bit?
This post is from stm32/stm8

Comments

I don't know about this either, you need to read the data sheet carefully. Generally, these data formats and timing diagrams are included in the manual.  Details Published on 2019-4-4 15:45
 
 

12

Posts

0

Resources
4
 
HX8238
This post is from stm32/stm8
 
 
 

9

Posts

0

Resources
5
 
qiujiao posted on 2019-4-4 14:37 Thank you, how do you identify which register to write to? Is it when spi sends, one bit is compared with the content sent?
I don't know about this either, you need to read the data sheet carefully. Generally, these data formats and timing diagrams are in the manual.
This post is from stm32/stm8
 
 
 

1

Posts

1

Resources
6
 

SPI data is not 8 bits, but 9 bits. The highest bit represents command or data. For example, 0x00** represents command and 0x01** represents data.

This post is from stm32/stm8
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list