lcd1602液晶显示程序
lcd1602是字符型液晶屏,可以显示2行,可以显示16个字符。这款产品市场上大多数都是用的SPLC780D的芯片,和KS0066兼容。拿我们CYW-B1602A来看,下面是编程资料:
RS EQU P3.3
RW EQU P3.1
E EQU P3.0
ORG 0000H
LJMP MAIN
ORG 0200H
mesg_num: DB 20H,21H,22H,23H,24H,25H,26H,27H,28H,29H,2AH,2BH,2CH,2DH,2EH,2FH,30H,31H,32H,33H
DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
mesg_char: DB 34H,35H,36H,37H,38H,39H,3AH,3BH,3CH,3DH,3EH,3FH,40H,41H,42H,43H,44H,45H,46H,47H
DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
mesg_num1: DB 48H,49H,4AH,4BH,4CH,4DH,4EH,4FH,50H,51H,52H,53H,54H,55H,56H,57H,58H,59H,5AH,5BH
DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
mesg_char1: DB 5CH,5DH,5EH,5FH,60H,61H,62H,63H,64H,65H,66H,67H,68H,69H,6AH,6BH,6CH,6DH,6EH,6FH
DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
mesg_num2: DB 70H,71H,72H,73H,74H,75H,76H,77H,78H,79H,7AH,7BH,7CH,7DH,7EH,7FH,80H,81H,81H,82H
DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
mesg_char2: DB 83H,84H,85H,86H,87H,88H,89H,8AH,8BH,8CH,8DH,8EH,8FH,90H,91H,92H,93H,94H,95H,96H
DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
mesg_num3: DB 97H,98H,99H,9AH,9BH,9CH,9DH,9EH,9FH,0A0H,0A1H,0A2H,0A3H,0A4H,0A5H,0A6H,0A7H,0A8H,0A9H,0AAH
DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
mesg_char3: DB 0ABH,0ACH,0ADH,0AEH,0AFH,0B0H,0B1H,0B2H,0B3H,0B4H,0B5H,0B6H,0B7H,0B8H,0B9H,0BAH,0BBH,0BCH,0BDH,0BEH
DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
mesg_num4: DB 0BFH,0C0H,0C1H,0C2H,0C3H,0C4H,0C5H,0C6H,0C7H,0C8H,0C9H,0CAH,0CBH,0CCH,0CDH,0CEH,0CFH,0D0H,0D1H,0D2H
DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
mesg_char4: DB 0D3H,0D4H,0D5H,0D6H,0D7H,0D8H,0D9H,0DAH,0DBH,0DCH,0DDH,0DEH,0DFH,0E0H,0E1H,0E2H,0E3H,0E4H,0E5H,0E6H
DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
mesg_num5: DB 0E7H,0E8H,0E9H,0EAH,0EBH,0ECH,0EDH,0EEH,0EFH,0F0H,0F1H,0F2H,0F3H,0F4H,0F5H,0F6H,0F7H,0F8H,0F9H,0FAH
DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
mesg_char5: DB 0FBH,0FCH,0FDH,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
mesg_num6: DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH
DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
mesg_char6: DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
DB 20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H,20H
CGRpatn: DB 1FH,1FH,1FH,1FH,1FH,1FH,1FH,00H
DB 01H,02H,04H,08H,10H,08H,04H,00H
DB 15H,15H,15H,15H,15H,15H,15H,00H
DB 0AH,0AH,0AH,0AH,0AH,0AH,0AH,00H
ORG 1400H
MAIN: MOV SP, #30H
ACALL PonInit ; initialize subroutine
MOV DPTR, #CGRpatn ; set address for pattern
MOV A, #04H ; No. of character to be initialise
ACALL CGRinit ; Write pattern into CGRAM
START: MOV DPTR, #mesg_num
ACALL mesg_out
MOV R4, #0A0H
ACALL delayXms
MOV DPTR, #mesg_char
ACALL mesg_out
MOV R4, #0A0H
ACALL delayXms
MOV DPTR, #mesg_num1
ACALL mesg_out
MOV R4, #0A0H
ACALL delayXms
MOV DPTR, #mesg_char1
ACALL mesg_out
MOV R4, #0A0H
ACALL delayXms
MOV DPTR, #mesg_num2
ACALL mesg_out
MOV R4, #0A0H
ACALL delayXms
MOV DPTR, #mesg_char2
ACALL mesg_out
MOV R4, #0A0H
ACALL delayXms
MOV DPTR, #mesg_num3
ACALL mesg_out
MOV R4, #0A0H
ACALL delayXms
MOV DPTR, #mesg_char3
ACALL mesg_out
MOV R4, #0A0H
ACALL delayXms
MOV DPTR, #mesg_num4
ACALL mesg_out
MOV R4, #0A0H
ACALL delayXms
MOV DPTR, #mesg_char4
ACALL mesg_out
MOV R4, #0A0H
ACALL delayXms
MOV DPTR, #mesg_num5
ACALL mesg_out
MOV R4, #0A0H
ACALL delayXms
MOV DPTR, #mesg_char5
ACALL mesg_out
MOV R4, #0A0H
ACALL delayXms
MOV DPTR, #mesg_num6
ACALL mesg_out
MOV R4, #0A0H
ACALL delayXms
MOV DPTR, #mesg_char6
ACALL mesg_out
MOV R4, #0A0H
ACALL delayXms
LJMP start
; ***********************************************************************
; routine : mesg_out
;
; Description :
;
; ***********************************************************************
mesg_out: MOV R4,#20
MOV A,#80H
ACALL WIR8
m_out1: CLR A
MOVC A, @A+DPTR
ACALL WDR8
INC DPTR
上面的资料仅供参考,详细的资料请参考IC资料!
———————————————————————————————————————
深圳驰宇微科技有限公司
Tel:+86-755-29446830
Mobile:13640934827(微信号)
http://www.cywlcd.com
Add:深圳市龙华新区大浪街道华宁路伟华达工业园C1栋七楼
驰宇微---11年专业研发、生产与销售【点阵液晶显示模块】和【段码液晶屏】,售前、售后技术支持,性能稳定可靠!
深圳驰宇微液晶模块厂家主要研发生产:
1. 单色液晶屏点阵式lcd,包括:12864液晶模块、12864液晶屏、320240液晶模块、320240液晶屏、240128液晶模块、240128液晶屏、160128液晶模块、160128液晶屏、24064液晶模块、24064液晶屏、19264液晶模块、19264液晶屏、16032液晶模块、16032液晶屏、12232液晶模块、12232液晶屏等点阵液晶显示模块和带中文字库液晶屏。
2. 单色液晶屏字符液晶模块,包括:0802液晶模块、1602液晶模块、1604lcd液晶模块、2002液晶模块、2004液晶模块等。
3. 段码液晶屏包括:VA LCD、 TN LCD、HTN LCD、STN LCD、FSTN LCD等笔段式LCD。
广泛应用于:医疗设备、仪器仪表、汽车电子、工控设备、电表、水表、温控器、智能家居等众多产品。不管是点阵液晶还是段式液晶,都可按要求定制液晶屏。
驰宇微首页 | 图形点阵液晶模块 | 中文字库液晶模块 | 字符型液晶模块 | 段码液晶模块 | 产品列表 | 站点地图 | 关于驰宇微
公司名称: 深圳驰宇微科技有限公司
备案号:粤ICP备14047421号
公司地址:深圳市龙华区大浪街道华昌路241号鸿源工业区E栋5层
公司电话:0755-29446830 13640934827
邮 箱:18926046819@163.com Q Q:577895076
版权归深圳驰宇微科技所有