slide1 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
CH 3 文字型液晶顯示器 PowerPoint Presentation
Download Presentation
CH 3 文字型液晶顯示器

Loading in 2 Seconds...

play fullscreen
1 / 28

CH 3 文字型液晶顯示器 - PowerPoint PPT Presentation


  • 170 Views
  • Uploaded on

CH 3 文字型液晶顯示器. 中華科技大學電子工程學系 2012/10/15. HD44780 Feature. Display Data RAM : 80*8 Bytes (DDRAM). Character Generator ROM (CGROM) 內建 160 個 5*7 字型. Character Generator RAM (CGRAM) : 64 自行規劃 8 個 5*7 字型. Display Principle. 假如希望在 LCD 某個位置顯示某個字型 , 請將

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'CH 3 文字型液晶顯示器' - malise


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
slide1

CH 3 文字型液晶顯示器

中華科技大學電子工程學系 2012/10/15

slide2

HD44780 Feature

  • Display Data RAM : 80*8 Bytes (DDRAM)
  • Character Generator ROM (CGROM)
  • 內建 160 個 5*7 字型
  • Character Generator RAM (CGRAM) : 64
  • 自行規劃 8 個 5*7 字型
display principle
Display Principle

假如希望在LCD某個位置顯示某個字型, 請將

該字型的ASCII碼寫入相對應的DD RAM位址中

1 2 3 4 5 6 7 8 9 10

A

F

DD RAM

(ASCII Code)

lcm access control
LCM Access Control
  • Instruction Register IR: WLCD_COMMAND

存取 LCM 指令碼 (only write)

  • Data Register DR: WLCD_DATA

存取 LCM 顯示資料 ( read & write)

PIN 6 4 5

E

RS

R/W

Operation Mode

0

0

Command IR

0

1

U’C BF & AC

1

0

Display Data DR

1

1

U’C Display Data

lcm access timing
LCM Access Timing

WLCD_DATA

RS

R/W

WLCD_COMMAND

E

Data

slide8

模組 1 : 設定游標的位置

輸入暫存器 : R2 => 第一列 R2=#8?H, 第二列 R2=#0C?H

WLCD_COMMAND:

CLR LCD_RW

CLR LCD_RS

SETB LCD_E

MOV LCD_BUS,R2

CLR LCD_E

SETB LCD_RS

SETB LCD_RW

MOV R4,#20

CALL DELAY_01MS

RET

slide9

模組 2 : 在 LCD 面板上顯示一個字元

輸入暫存器 : R2 = 該字元的 ASCII 碼

WLCD_DATA:

CLR LCD_RW

SETB LCD_RS

SETB LCD_E

MOV LCD_BUS,R2

CLR LCD_E

SETB LCD_RS

SETB LCD_RW

MOV R4,#20

CALL DELAY_01MS

RET

slide10

;

模組 3 : 初始化 LCD 模組

輸入暫存器 : 無

SET_LCD:

MOV R2,#00111000B

CALL WLCD_COMMAND

MOV R2,#00001100B

CALL WLCD_COMMAND

MOV R2,#00000110B

CALL WLCD_COMMAND

RET

slide11

模組 4 : 清除 LCD 螢幕

輸入暫存器 : 無

CLEAR_LCD:

MOV R2,#00000001B

CALL WLCD_COMMAND

MOV R2,#00000010B

CALL WLCD_COMMAND

RET

slide12

模組 5 : 顯示一個字串

輸入暫存器 : DPTR => 字串表格的起始位址

DISP_LCD_STRING:

MOV R1,#00

DISP_1:

MOV A,R1

MOVC A,@A+DPTR

MOV R2,A

XRL A,#80H

JZ DISP_2

CALL WLCD_DATA

INC R1

JMP DISP_1

DISP_2:

RET

slide13

模組 6 : 顯示一組16進制資料

輸入暫存器 : R1 => 16進制資料

DISP_LCD_HEX:

MOV A,R1

ANL A,#0F0H

SWAP A

MOV R2,A

CALL DISP_BINARY

MOV A,R1

ANL A,#0FH

MOV R2,A

CALL DISP_BINARY

RET

slide14

DISP_BINARY:

CLR C

MOV A,R2

SUBB A,#10

JC LESS_10

JMP LARGE_9

LESS_10:

MOV A,R2

ADD A,#30H

MOV R2,A

CALL WLCD_DATA

RET

LARGE_9:

MOV A,R2

ADD A,#37H

MOV R2,A

CALL WLCD_DATA

RET

slide15

模組 7 : 造字(圖案造型)模組

輸入暫存器 : R5 => 建立字數

DPTR => 造字或圖案的表格名稱

最多祇能造八個字

slide16

ELCD_CHAR_PATTERN:

MOV R6,#00H

MOV A,R5

RL A

RL A

RL A

MOV R5,A

MOV R2,#40H

CALL WLCD_COMMAND

ELCD1:

MOV A,R6

MOVC A,@A+DPTR

MOV R2,A

CALL WLCD_DATA

INC R6

DJNZ R5,ELCD1

RET

slide17
實作練習(一)

在 LCD 螢幕上顯示單一字元

(1) 在第一列第 5 個位址顯示一個阿拉伯數字

(2) 在第一列第 13 個位址顯示一個英文字母

(3) 在第二列第 7 個位址顯示一個運算符號

(4) 在第二列第 15 個位址顯示一個<,=,>符號

slide19

;===========================================

; TLCD_1 : TESTING LCD MODULE FUNCTION

; SHOW CHAR

; 2012/9/4 , TPS

;===========================================

LCD_BUS EQU P

LCD_E EQU P

LCD_RW EQU P

LCD_RS EQU P

ORG 00H

JMP START

START:

CALL

CALL

MOV

CALL WLCD_COMMAND

MOV

CALL WLCD_DATA

slide20

MOV

CALL WLCD_COMMAND

MOV

CALL WLCD_DATA

MOV

CALL WLCD_COMMAND

MOV

CALL WLCD_DATA

MOV

CALL WLCD_COMMAND

MOV

CALL WLCD_DATA

JMP $

END

slide21
實作練習(二)
  • 在 LCD 螢幕上顯示兩行字串
  • 第一列:
  • STR1_TABLE:
  • DB “VOLTAGE VALUE= ",80H
  • (2)第二列:
  • STR2_TABLE:
  • DB "CURRENT VALUE= ",80H
  • (3) 第一列加入 :7D 十六進制資料
  • (4) 第二列加入 :E9 十六進制資料
slide22

;===========================================

; TLCD_2 : TESTING LCD MODULE FUNCTION

; SHOW STRING

; 2011/5/7 , TPS

;===========================================

LCD_BUS EQU P

LCD_E EQU P

LCD_RW EQU P

LCD_RS EQU P

ORG 00H

JMP START

START:

CALL

CALL

MOV

CALL WLCD_COMMAND

MOV ,#

CALL DISP_LCD_STRING

slide23

MOV

CALL WLCD_COMMAND

MOV

CALL DISP_LCD_STRING

JMP $

STR1_TABLE:

DB "VOLTAGE VALUE= ",80H

STR2_TABLE:

DB "CURRENT VALUE= ",80H

END

home work 10 14
Home Work (10/14):
  • 在 LCD 螢幕上顯示 :
  • 2013/10/14 (一)
  • PM 3:12:56
  • 2. 在 LCD 螢幕上顯示 : A
  • 該字元每隔 1 秒向右邊移一個字元
  • 3. 在 LCD 螢幕上顯示 :
  • XieHe HighSchool
  • 該字串每隔 1 秒向右邊移一個字元
slide25
實作練習(三)

在 LCD 螢幕上顯示一只老鼠

MOUSE_TABLE:

DB 00H,08H,04H,03H,04H,08H,0AH,0DH ;PATTERN 1

DB 00H,02H,04H,18H,04H,02H,0AH,16H ;PATTERN 2

DB 1FH,0CH,0AH,09H,08H,0EH,0EH,1FH ;PATTERN 3

DB 1FH,06H,0AH,12H,02H,0EH,0EH,1FH ;PATTERN 4

slide26
實作練習(三)

在 LCD 螢幕上顯示一只老鼠

MOUSE_TABLE:

DB 00H,08H,04H,03H,04H,08H,0AH,0DH ;PATTERN 1

DB 00H,02H,04H,18H,04H,02H,0AH,16H ;PATTERN 2

DB 1FH,0CH,0AH,09H,08H,0EH,0EH,1FH ;PATTERN 3

DB 1FH,06H,0AH,12H,02H,0EH,0EH,1FH ;PATTERN 4

slide27

;===========================================

; TLCD_5 : MOUSE AMIMATION

; SHOW MOUSE AND SHIFT

; 2011/5/21, TPS

;===========================================

LCD_BUS EQU P

LCD_E EQU P

LCD_RW EQU P

LCD_RS EQU P

ORG 00H

JMP START

START:

CALL

CALL

MOV R5,#

MOV DPTR,#

CALL

slide28

MOV

CALL WLCD_COMMAND

MOV

CALL WLCD_DATA

MOV

CALL WLCD_DATA

MOV

CALL WLCD_COMMAND

MOV

CALL WLCD_DATA

MOV

CALL WLCD_DATA

JMP $

MOUSE_TABLE:

DB 00H,08H,04H,03H,04H,08H,0AH,0DH ;PATTERN 1

DB 00H,02H,04H,18H,04H,02H,0AH,16H ;PATTERN 2

DB 1FH,0CH,0AH,09H,08H,0EH,0EH,1FH ;PATTERN 3

DB 1FH,06H,0AH,12H,02H,0EH,0EH,1FH ;PATTERN 4

END