This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Change the RTX51 Tiny's Timer0 to Timer2

I want to change the kernel's Timer0 to Timer2 when using RTX51 Tiny. Now I have modified something in file Conf_tny.A51:

Code-1

;CSEG    AT      0x0B ;Timer0 interrupt adress (oringal code)
CSEG    AT      0x2B  ;Timer2 interrupt adress
JMP     TIMERINT

Code-2

; Update 8051 Interrupt Timer
CLR     TF2 ï¼›Clear Timer2 TF
;CLR    TR0 ï¼›(oringal code)
;MOV    A,TL0
;ADD    A,#LOW (?RTX_CLOCK + 7)
;MOV    TL0,A
;MOV    A,TH0
;ADDC   A,#HIGH (?RTX_CLOCK + 7)
;MOV    TH0,A
;SETB   TR0

Code-3

;ORL    TMOD,#01H       ; Timer 0 Mode 1 (oringal code)
;MOV    TL0,#LOW (?RTX_CLOCK)
;MOV    TH0,#HIGH (?RTX_CLOCK)
;SETB   TR0
;SETB   EA
;SETB   ET0
CLR TR2
CLR TF2
MOV T2CON,#00H    ; Timer 2 Mode 1
MOV T2MOD,#80H
MOV TMCON,#04H
MOV TL2,#LOW (?RTX_CLOCK)
MOV TH2,#HIGH (?RTX_CLOCK)
MOV RCAP2L,#LOW (?RTX_CLOCK + 7)
MOV RCAP2H,#HIGH (?RTX_CLOCK + 7)
SETB TR2
SETB EA
SETB ET2

After debugging simulation, I found an exception in os_wait(). What else do I need to modify?

0