簡體   English   中英

如何初始化LCD的4位操作

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

我很難找到簡潔的教程來重新定義LCD控制器的初始化。 我已經閱讀了數據表,其中有特定的位序列應發送到LCD。 這樣的初始化順序如下所示:

在此處輸入圖片說明

我根本無法遵循此處提供的信息。 我可以看到,前幾步需要用戶為設備供電,等待足夠的時間,然后設置幾條數據線的狀態。 我可以通過以下內容理解:

假設我們使用以下字節格式:D7 D6 D5 D4 RS RW XX

  • 打開
  • 等待> 40mS
  • 寫0011 0000 => 0x30
  • 等待> 4.1mS
  • 寫0011 0000 => 0x30
  • 等待> 100uS
  • 寫0011 0000 => 0x30

之后我不知道。 我搜尋了數據表,卻發現很少解釋下面顯示的對N,I / D,D,B,F,C的引用(有些未顯示)。 此外,我閱讀過的任何教程都經常引用一個不確定的神秘的“ 函數集 ”(即下面的函數集:接口長8位 ?)。

我擁有的實際LCD型號是:WH2004A-CFH-JT#但據我所讀,大多數LCD是HD44780的派生產品

這樣,我初始化該顯示器的第一個嘗試就是實現該顯示器數據表中給出的順序。

有什么好的資源可以推薦嗎? 誰能解釋“功能集”以及相關的變量B,C,F,I / D等。

此外,是否只是在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)

進行檢查BF標志的讀寫操作。

這可能會對您有所幫助...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM