Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/18/03 11:33
Read: times


 
#36717 - RE: Use both 2051 Timers
Here is the code which not work correctly. No timer are not work. Before two days functioned at least still another timer!
- - - - - - - - - - - - - - - - - - - - - - -

INCLUDE 89C2051.MC

timer0_ext24 DATA 08h
timer1_ext24 DATA 09h

TL0PRE EQU 219
TH0PRE EQU 11
TX0PRE EQU 16

TL1PRE EQU 219
TH1PRE EQU 11
TX1PRE EQU 32

ORG 0h
jmp start

ORG 1Bh
jmp timer1_int

ORG 0Bh
jmp timer0_int

; Interrupt Timer 1
timer1_int:
mov TL1, #TL1PRE
mov TH1, #TH1PRE
djnz timer1_ext24,timer1_int_label
mov timer1_ext24,#TX1PRE
acall timer1_int_label

ret

timer1_int_label:
reti

; Interrupt Timer 0
timer0_int:
mov TL0, #TL0PRE
mov TH0, #TH0PRE
djnz timer0_ext24,timer0_int_label
mov timer0_ext24,#TX0PRE
acall timer0_int_label

ret

timer0_int_label:
reti

; Init
start:

; Timer 0
; 500 ms
mov TL0, #TL0PRE
mov TH0, #TH0PRE
mov timer0_ext24,#TX0PRE

; Timer 1
; 1000 ms
mov TL1, #TL1PRE
mov TH1, #TH1PRE
mov timer1_ext24,#TX1PRE

; SFR's init
mov SP, #20h
mov TMOD,#17
mov TCON,#80
mov IE, #138

main:
jmp main


List of 14 messages in thread
TopicAuthorDate
Use both 2051 Timers            01/01/70 00:00      
RE: Use both 2051 Timers            01/01/70 00:00      
RE: Use both 2051 Timers            01/01/70 00:00      
RE: Use both 2051 Timers            01/01/70 00:00      
RE: Use both 2051 Timers            01/01/70 00:00      
RE: Use both 2051 Timers            01/01/70 00:00      
RE: Use both 2051 Timers            01/01/70 00:00      
RE: Use both 2051 Timers            01/01/70 00:00      
RE: Use both 2051 Timers            01/01/70 00:00      
RE: Use both 2051 Timers            01/01/70 00:00      
RE: Use both 2051 Timers            01/01/70 00:00      
RE: Use both 2051 Timers            01/01/70 00:00      
RE: Use both 2051 Timers            01/01/70 00:00      
RE: Use both 2051 Timers            01/01/70 00:00      

Back to Subject List