??? 12/10/09 07:33 Read: times |
#171536 - Clearing TF2 in ISR Responding to: ???'s previous message |
Hi David!
The ISR now looks like ORG 002BH ; INTERRUPT SERVICE ROUTINE FOR T2 LJMP ISR_T2 ; for calling Inputs subroutine ORG 0080h ; ISR_T2: CLR TF2 ; T2 Flag cleared DJNZ CTR, EXIT ; Don't call Inputs unless counter=0 ACALL INPUTS ; ELSE CALL INPUTS SUBROUTINE MOV CTR, #0AH ; RESET COUNTER TO 0Ah EXIT: CLR EXF2 ; (CLR EXF2 => T2CON.6) RETI ; RETURN FROM INTERRUPT I shall also try to implement your suggestion regarding comments(meaninigful ofcourse). But P1.1 is toggled continously during running of program, why? & how do I stop this? Thanks, Sandy |
Topic | Author | Date |
Problem using Timer2 in 89S52! | 01/01/70 00:00 | |
not a very useful suggestion from 'Plz' | 01/01/70 00:00 | |
further suggestion | 01/01/70 00:00 | |
Message & Readable code is here... | 01/01/70 00:00 | |
look in the assembler manual | 01/01/70 00:00 | |
New Code, hope it helps! | 01/01/70 00:00 | |
what You are trying to make ? | 01/01/70 00:00 | |
mov T2MOD,#4 | 01/01/70 00:00 | |
sorry | 01/01/70 00:00 | |
t2mod=0 ; t2con=4 (tr2=1) It worked!![]() | 01/01/70 00:00 | |
PSW | 01/01/70 00:00 | |
that is not a comment! | 01/01/70 00:00 | |
Comments OR Explaination!!! | 01/01/70 00:00 | |
Comments are mainly for YOU | 01/01/70 00:00 | |
WRONG! | 01/01/70 00:00 | |
Answer the "why" in your comments. | 01/01/70 00:00 | |
I got (I)T2 working !!! | 01/01/70 00:00 | |
Clear TF2 in your service routine | 01/01/70 00:00 | |
Clearing TF2 in ISR | 01/01/70 00:00 |