; ********************************************
; FuncTIon : 5X7LED点阵显示示例程序 *
; MICroProcessor : HT48R50A-1/28SKDIP-A *
; Author: *
; Crystal : 4MHz *
; ********************************************
#INCLUDE HT48R50A-1.INC
;---------------------------------------------
DATA .SECTION AT 60H 'DATA'
LOOP_COUNTER DB ? ;[60H]
DISPLAY_COUNTER DB ? ;[61H]
DISPLAY_DATA DB ? ;[61H]
INDEX DB ? ;[62H]
SCAN_DATA DB ? ;[63H]
SCAN_COUNTER DB ? ;[64H]
DELAY_COUNTER DB ? ;[65H]
;---------------------------------------------
CODE .SECTION AT 00H 'CODE'
ORG 00H
JMP START
START:
CLR PAC
CLR PBC
CLR PCC
CLR TBLP
CLR INDEX
MOV A,10H
MOV LOOP_COUNTER,A
LOOP:
MOV A,0C0H
MOV DISPLAY_COUNTER,A
DISPLAY:
MOV A,INDEX
MOV TBLP,A
TABRDL DISPLAY_DATA
MOV A,DISPLAY_DATA
MOV PA,A
CLR PB
CALL DELAY
SET PB
CALL DELAY
INC TBLP
MOV A,0F7H
MOV SCAN_DATA,A
MOV A,04H
MOV SCAN_COUNTER,A
SCAN:
TABRDL DISPLAY_DATA
MOV A,DISPLAY_DATA
MOV PA,A
MOV A,SCAN_DATA
MOV PC,A
CALL DELAY
SET PC
CALL DELAY
INC TBLP
RR SCAN_DATA
SDZ SCAN_COUNTER
JMP SCAN
SDZ DISPLAY_COUNTER
JMP DISPLAY
MOV A,5
ADDM A,INDEX
SDZ LOOP_COUNTER
JMP LOOP
JMP START
RET
;---------------------------------------------
DELAY PROC
MOV A,0FFH
MOV DELAY_COUNTER,A
WAIT:
SDZ DELAY_COUNTER
JMP WAIT
RET
DELAY ENDP
;---------------------------------------------
ORG 0F00H
DC 0C1H,0BEH,0BEH,0BEH,0C1H ;0
DC 0FEH,0FEH,080H,0DEH,0FEH ;1
DC 0CEH,0B6H,0BAH,0BCH,0CEH ;2
DC 0C9H,0B6H,0B6H,0BEH,0DDH ;3
DC 0FBH,080H,0DBH,0EBH,0F3H ;4
DC 0B9H,0B6H,0B6H,0B6H,086H ;5
DC 0D9H,0B6H,0B6H,0B6H,0C1H ;6
DC 08FH,0B3H,0BCH,0BFH,09FH ;7
DC 0C9H,0B6H,0B6H,0B6H,0C9H ;8
DC 0C1H,0B6H,0B6H,0B6H,0CDH ;9
DC 0E0H,0DBH,0BBH,0DBH,0E0H ;A
DC 0C9H,0B6H,0B6H,0B6H,080H ;B
DC 0DDH,0BEH,0BEH,0BEH,0C1H ;C
DC 0E3H,0DDH,0BEH,0BEH,080H ;D
DC 0BEH,0B6H,0B6H,0B6H,080H ;E
DC 0BFH,0B7H,0B7H,0B7H,080H ;F
;---------------------------------------------
END
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)