段码液晶屏主要是用来替代LED数码管,它是由7个笔段所组成,用来显示数字0~9,比如我们平时看到的计算器、加油站的显示器、电表、水表等,显示的汉字、logo等都是固定的,只是数字可以变动。
段码液晶屏用的比较多的是HT1621B的芯片,它可以驱动32×4=128个笔段,相当于16个“8”字。HT1621的接口是串行的,有CS,WR,RD(RD也可以不用),DATA几个引脚。
如下是段码液晶屏的汇编的编程资料,供大家参考:
CSA EQU P3.2
WR1621 EQU P3.0
;DA P1.7
ORG 0000H
LJMP MAIN
; 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 ,14 , 15 , 16 , 17, 18, 19, 20, 21, 22, 23,
SC0: DB 0A0H,0F0H,0A0H,0F0H,0A0H,0F0H,0A0H,0F0H,0A0H,0F0H,0A0H,0F0H,0A0H,0F0H,0A0H,0F0H,0F0H,050H,0F0H,050H,0F0H,050H,000H
SC1: DB 000H,060H,000H,060H,000H,060H,000H,060H,000H,060H,000H,060H,000H,060H,000H,060H,060H,000H,060H,000H,060H,000H,000H
SC2: DB 0C0H,0B0H,0C0H,0B0H,0C0H,0B0H,0C0H,0B0H,0C0H,0B0H,0C0H,0B0H,0C0H,0B0H,0C0H,0B0H,0D0H,030H,0D0H,030H,0D0H,030H,000H
SC5: DB 060H,0D0H,060H,0D0H,060H,0D0H,060H,0D0H,060H,0D0H,060H,0D0H,060H,0D0H,060H,0D0H,0B0H,060H,0B0H,060H,0B0H,060H,000H
SC8: DB 0E0H,0F0H,0E0H,0F0H,0E0H,0F0H,0E0H,0F0H,0E0H,0F0H,0E0H,0F0H,0E0H,0F0H,0E0H,0F0H,0F0H,0E0H,0F0H,0E0H,0F0H,0E0H,000H
SCA: DB 0F0H,0F0H,0E0H,0F0H,0F0H,0F0H,0E0H,0F0H,0F0H,0F0H,0E0H,0F0H,0F0H,0F0H,0E0H,0F0H,0F0H,0F0H,0F0H,0E0H,0F0H,0F0H,010H
SCB: DB 0E0H,0F0H,0F0H,0F0H,0E0H,0F0H,0F0H,0F0H,0E0H,0F0H,0F0H,0F0H,0E0H,0F0H,0F0H,0F0H,0F0H,0E0H,0F0H,0F0H,0F0H,0E0H,030H
SCC: DB 0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,070H
SCD: DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H
SC11: DB 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H, 00H
ORG 0400H
MAIN: MOV SP, #30H
ACALL Initial ; initialize 1622
MOV DPTR, #SC0
ACALL mesg_out2
MOV R7, #2fH
ACALL delayXms
MOV DPTR, #SC1
ACALL mesg_out2
MOV R7, #2fH
ACALL delayXms
MOV DPTR, #SC2
ACALL mesg_out2
MOV R7, #2fH
ACALL delayXms
MOV DPTR, #SC5
ACALL mesg_out2
MOV R7, #2fH
ACALL delayXms
MOV DPTR, #SC8
ACALL mesg_out2
MOV R7, #2fH
ACALL delayXms
MOV DPTR, #SCA
ACALL mesg_out2
MOV R7, #2fH
ACALL delayXms
MOV DPTR, #SCB
ACALL mesg_out2
MOV R7, #2fH
ACALL delayXms
MOV DPTR, #SCC
ACALL mesg_out2
MOV R7, #2fH
ACALL delayXms
MOV DPTR, #SCC
ACALL mesg_out2
MOV R7, #2fH
ACALL delayXms
MOV DPTR, #SCC
ACALL mesg_out2
MOV R7, #2FH
ACALL delayXms
MOV DPTR, #SCC
ACALL mesg_out2
MOV R7, #6fH
ACALL delayXms
MOV DPTR, #SCC
ACALL mesg_out2
MOV R7, #6fH
ACALL delayXms
MOV DPTR, #SC11
ACALL mesg_out2
MOV R7, #6fH
ACALL delayXms
LJMP MAIN
; ***********************************************************************
; routine : mesg_out
;
; Description :
;
; ***********************************************************************
mesg_out2:
setb csA
nop
nop
CLR CSA
nop
nop
nop
nop
nop
nop
MOV A, #0A0H
ACALL WcommandID
MOV A, #00h
ACALL Wmadd
nop
nop
nop
nop
nop
nop
SETB WR1622
MOV R5,#23
BB: MOV R4,#4
CLR A
MOVC A, @A+DPTR
EE: CLR WR1622
MOV P1, A
RL A
nop
nop
nop
nop
nop
nop
SETB WR1622
nop
nop
nop
nop
nop
nop
DJNZ R4, EE
INC DPTR
DJNZ R5, BB
; SETB CSA
RET
; ***********************************************************************
; routine : PonInit
;
; Description :
;
; ***********************************************************************
Initial: setb csA
nop
CLR CSA
MOV A, #80H ;Write command ID(100)
ACALL WcommandID
MOV A, #14H ;Turn on system osciallator
ACALL Writecommand
MOV A, #01H ;Turn on system osciallator
ACALL Writecommand
MOV A, #09H ;Turn on system osciallator
ACALL Writecommand
MOV A, #03H ;Turn on LCD display
ACALL Writecommand
MOV A, #00101001b ;1/4 duty,1/3 bias
ACALL Writecommand
MOV A, #00011000b ;on chip rc oscillator
ACALL Writecommand
SETB CSA
RET
WcommandID: MOV R4,#3
SETB WR1622
nop
nop
nop
nop
nop
nop
NOP
AA: CLR WR1622
nop
nop
nop
nop
nop
nop
NOP
MOV P1, A
RL A
nop
nop
nop
nop
nop
nop
SETB WR1622
nop
nop
nop
nop
nop
nop
DJNZ R4, AA
RET
Wmadd: SETB WR1622
MOV R4,#6
CC: CLR WR1622
nop
nop
nop
nop
nop
nop
NOP
MOV P1, A
RL A
nop
nop
nop
nop
nop
nop
SETB WR1622
nop
nop
nop
nop
nop
nop
DJNZ R4, CC
RET
Writecommand:
SETB WR1622
MOV R4,#8
AAA: CLR WR1622
nop
nop
nop
nop
nop
nop
NOP
MOV P1, A
RL A
nop
nop
nop
nop
nop
nop
SETB WR1622
nop
nop
nop
nop
nop
nop
DJNZ R4, AAA
CLR WR1622
nop
nop
nop
nop
nop
nop
NOP
SETB P1.0
SETB WR1622
RET
; ***********************************************************************
; routine : delayXms
;
; Description : No. of ms is defined by Register R7
;
; ***********************************************************************
delayXms: ACALL delay2ms
ACALL delay2ms
ACALL delay2ms
ACALL delay2ms
DJNZ R7,delayXms
RET
; ***********************************************************************
; routine : delay2ms
;
; Description : 1 ms delay loop
;
; ***********************************************************************
delay2ms: MOV R2,#06H ; 1st delay loop 256us * 8 = 2ms
delay_0: MOV R3,#0FFH ; 2nd delay loop 1us * 256 = 256us
delay_1: DJNZ R3, delay_1
DJNZ R2, delay_0
RET
END
需要了解更多,请咨询深圳驰宇微
蒋工Tel:+86-755- 29446830
Mobile:13640934827
http://www.cywlcd.com/cjwtj.html
http://map.baidu.com/?newmap=1&s=inf%26uid%3Da52aa43e5a4db9839fec2b79%26wd%3D%E9%A9%B0%E5%AE%87%E5%BE%AE%E7%A7%91%E6%8A%80%26all%3D1%26c%3D340&from=alamap&tpl=map_singlepoint
Add:深圳市龙华新区大浪街道华宁路伟华达工业园C1栋七楼
驰宇微首页 | 图形点阵液晶模块 | 中文字库液晶模块 | 字符型液晶模块 | 段码液晶模块 | 产品列表 | 站点地图 | 关于驰宇微
公司名称: 深圳驰宇微科技有限公司
备案号:粤ICP备14047421号
公司地址:深圳市龙华区大浪街道华昌路241号鸿源工业区E栋5层
公司电话:0755-29446830 13640934827
邮 箱:18926046819@163.com Q Q:577895076
版权归深圳驰宇微科技所有