Skip to content

Commit 40806c7

Browse files
authored
Add files via upload
1 parent dbce596 commit 40806c7

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

Timer_interface/output.png

54 KB
Loading

Timer_interface/timer.asm

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
ORG 00H
2+
3+
MOV TMOD, #01H // mode 1 (16 bit timer moder) ,timer 0
4+
again1: // while loop
5+
// led blink code
6+
MOV P1, #0FFH // logic 1
7+
ACALL DELAY
8+
MOV P1, #00H // logic 0
9+
ACALL DELAY
10+
SJMP again1 // short jump
11+
12+
// delay of 5ms 00H (0) TO 0EEH
13+
// 1 count = 1.085us
14+
// 4608 counts = 5ms
15+
// max counts = 65536 (2^16)
16+
// so 65536 - 4608 = 60928 counts =EE00 (in hex)
17+
18+
DELAY: MOV TL0, #00H
19+
MOV TH0, #0EEH
20+
SETB TR0 // to turn ON the timer(timer 0 control run bit)
21+
again: JNB TF0 ,again // flag bit when there is roll over from fffh to 000h(overflow flag)
22+
CLR TR0 // JNB - jump if bit is not set
23+
CLR TF0
24+
RET
25+
26+
END

0 commit comments

Comments
 (0)