简体   繁体   English

如何初始化LCD的4位操作

[英]How to initialize 4-bit operation of an LCD

I am having a hard time finding succinct tutorials regrading the initialization of an LCD controller. 我很难找到简洁的教程来重新定义LCD控制器的初始化。 I have read in the datasheet there is a specific sequence of bits that should be sent to the LCD. 我已经阅读了数据表,其中有特定的位序列应发送到LCD。 Such a initialization sequence is presented here: 这样的初始化顺序如下所示:

在此处输入图片说明

I simply cannot follow the information presented here. 我根本无法遵循此处提供的信息。 I can see that the first few steps require the user to power the device, wait a sufficient amount of time, and then set the state of a few data lines. 我可以看到,前几步需要用户为设备供电,等待足够的时间,然后设置几条数据线的状态。 I can understand through the following: 我可以通过以下内容理解:

Assuming we use the byte format as follows: D7 D6 D5 D4 RS RW XX 假设我们使用以下字节格式:D7 D6 D5 D4 RS RW XX

  • Power on 打开
  • wait >40mS 等待> 40mS
  • Write 0011 0000 => 0x30 写0011 0000 => 0x30
  • wait >4.1mS 等待> 4.1mS
  • write 0011 0000 => 0x30 写0011 0000 => 0x30
  • wait >100uS 等待> 100uS
  • write 0011 0000 => 0x30 写0011 0000 => 0x30

After which I have no idea. 之后我不知道。 I have scoured the datasheet and have found little explaining the references to N, I/D, D, B, F, C shown below (some not shown). 我搜寻了数据表,却发现很少解释下面显示的对N,I / D,D,B,F,C的引用(有些未显示)。 Further, any tutorial I have read often references a mysterious " Function Set " (ie below with Function set: interface is 8 bits long ?) that am unsure about. 此外,我阅读过的任何教程都经常引用一个不确定的神秘的“ 函数集 ”(即下面的函数集:接口长8位 ?)。

The actual LCD model that I have is: WH2004A-CFH-JT# But from what I have read, most LCDs are derivatives of the HD44780 我拥有的实际LCD型号是:WH2004A-CFH-JT#但据我所读,大多数LCD是HD44780的派生产品

As such, my first attempt at initializing this display was going to be realizing the sequence given in the datasheet for that display. 这样,我初始化该显示器的第一个尝试就是实现该显示器数据表中给出的顺序。

Are there any good resources that would be recommended? 有什么好的资源可以推荐吗? Can anyone explain what the "Function Set is and the associated variables B, C, F, I/D .. etc? 谁能解释“功能集”以及相关的变量B,C,F,I / D等。

Further, is it that once in 4-bit mode that information is sent to the LCD simply by first presenting the 4-bit nibble of the highest data bits (7, 6, 5, 4), clocking in that data, and then repeating with the lower-bit nibble? 此外,是否只是在4位模式下,通过首先呈现最高数据位(7、6、5、4)的4位半字节,输入该数据的时钟,然后重复发送,即可将信息发送到LCD。低位蚕食?

B ->  The character at the the cursor position blinks when B = 1
Blinking is performed by switching between all blank dots and the display character

C ->  The cursor is displayed when C = 1 and is not displayed when C = 0.
The cursor is displayed as 5 dots in the 8th line when the 5 x 7 dot character font is selected and as 5 dots in the 11th line when the 5 x 10 dot character font is selected. 

    enter code here

D ->  The display is ON when D = 1 and OFF when D = 0. The DD RAM contents remain unchanged.    

Function set specifies of 
    1. DL -> number data length (4 bit or 8 bit) 
        Data sent or received in 8 bit lengths (DB7-DB0) when DL = 1
        Data sent or received in 4 bit lengths (DB7-DB4) when DL = 0 
    2.N -> Sets number of display lines.
    3.f -> Sets character font.

After setting function set , set CGRAM Address and DDRAM Address (Refer Data Sheet)

that check BF flag read and write operation is performed. 进行检查BF标志的读写操作。

This might be help you in bit... 这可能会对您有所帮助...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM