T0作定时器汇编程序(查询法)
时间:12-02
来源:互联网
点击:
单片机T0作定时器实现数码管显示的汇编程序(查询法)
电路是:P0口接数码管的字型码笔段,P2口接数码管的数位选择端.
SECOND EQU 30H
TCOUNT EQU 31H
ORG 00H
START: MOV SECOND,#00H
MOV TCOUNT,#00H
MOV TMOD,#01H
MOV TH0,#(65536-50000)/256
MOV TL0,#(65536-50000) MOD 256
SETB TR0
DISP: MOV A,SECOND
MOV B,#10
div A B
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P0,A
MOV A,B
MOVC A,@A+DPTR
MOV P2,A
WAIT: JNB TF0,WAIT
CLR TF0
MOV TH0,#(65536-5000)/256
MOV TL0,#(65536-5000) MOD 256
INC TCOUNT
MOV A,TCOUNT
CJNE A,#20,NEXT
MOV TCOUNT,#00H
INC SECOND
MOV A,SECOND
CJNE A,#60,NEXT
MOV SECOND,#00H
NEX: LJMP DISP
NEXT: LJMP WAIT
TABLE: DB 3FH,06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH
END
T0定时器汇编程序查询 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)