??? 10/26/05 06:20 Read: times |
#102954 - one caution Responding to: ???'s previous message |
hi,
Sarang Patki said:
For Timer 2 interrupt the vector address is 002BH Unlike timers 0 and 1, timer 2 has its interrupt vector shared with interrupt produced with Timer/Counter 2 capture/reload trigger and direction control via pin T2EX. Even you have disabled this feature by EXEN2=0 nevertheless it is good practice to check the source of interrupt when come to ISR which vector is shared. The another effect of that I said above, is that hardware does not clear TF2 flag. Hardware clears TF0/TF1 flags of timers 0/1 but timer 2 requires to clear the flag by software. This bahaviour allows user to determine the source of interrupt. So do not forget to clear TF2 flag yourself inside ISR. Regards, Oleg |