Title: Microprocessor with 8051
1Microprocessor with 8051 Timer , Counter
20003064 ??? 20013232 ??? 20023268 ???
Microprocessor
2Contents
???? ?? ? ?? ???? ?? ??? ??? ? ???? ?? ???? ? ???
Microprocessor with 8051 Timer, Counter
3???? ?? ? ??
? ?? - Timer, Counter ? ???? ?? - Timer,
Counter ??? ???? ??? ???? - Keil uVision II ?
??? ??? ? ???? ?? - ????? - C ??
1
Microprocessor Timer, Counter
4???? ?? ???
2
Microprocessor Timer, Counter
5???? ???
3
Microprocessor Timer, Counter
6???? ???
3
Microprocessor Timer, Counter
7???? ?? ??
ORG 00H JMP START START MOV SP,70H MOV T
MOD,00000000B MOV TH0,(8192-8000)/32 MOV A,11
111110B LOOP MOV P1,A MOV R4,5 CALL DEALY R
L A JMP LOOP DELAY JBC TF0,TMOUT JMP DELAY
TMOUT MOV TH0,(8192-8000)/32 DJNZ R4,DELAY
RET END
4
Microprocessor Timer, Counter
8C ?? ??
include ltreg51.hgt unsigned char
number,count void delay(void) count
5 do while(!TF0) TF0 0 TH0
6 count-- while(count) void
main(void) TMOD 0x00 TH0 6 ET0 1 EA
0 number 0xFE TR0 1 do P1
number delay() number (number ltlt 1)
1 if(number 0xFF) number0xFE while(1)
5
Microprocessor Timer, Counter
9???? ? ???
- ??? ??? SP? ?? ?? ??? ?? ??? ??
???? ?? ??, ??? ? ?? ??? ?? ??
6
Microprocessor Timer, Counter
107
Microprocessor Timer, Counter
11??? ????? ?????? ? ??? ?? ? ? ??.
7
??? ? ??? ?? ? ? ??.
Microprocessor Timer, Counter
127
Microprocessor Timer, Counter
137
Microprocessor Timer, Counter
147
Microprocessor Timer, Counter