用軟件延時(shí)實(shí)現(xiàn)00-59秒單片機(jī)計(jì)
DJNZ R5,D2
RET
5. 程序框圖
圖4.11.2
6. 匯編源程序
Second EQU 30H
ORG 0
START: MOV Second,#00H
NEXT: MOV A,Second
MOV B,#10
DIV AB
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV P0,A
MOV A,B
MOVC A,@A+DPTR
MOV P2,A
LCALL DELY1S
INC Second
MOV A,Second
CJNE A,#60,NEXT
LJMP START
DELY1S: MOV R5,#100
D2: MOV R6,#20
D1: MOV R7,#248
DJNZ R7,$
DJNZ R6,D1
DJNZ R5,D2
RET
加速度計(jì)相關(guān)文章:加速度計(jì)原理
評(píng)論