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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/19/08 21:58
Read: times


 
#149746 - When does timer 2 get reloaded?
Hello,
I'm using Atmel's AT89S52 16bit auto-reload timer2 interrupt to execute a long function every specific time, and I want to know if the timer gets reloaded after the interrupts ends (RETI) or when shortly after/before it gets called?

Because if its after then I'll need to calculate the interrupt function time to execute.....

Can I reload it myself on the start of the interrupt so it will run simultaneously....
something like this

void timer2_int() using 5 {
   //reload and start it myself
   TR2 = 0; 
   TF2 = 0;
   TH2 = 0x15; TL2 = 0xFF;
   TR2 = 1;

   //Long operation (1000~ mechine cycles) that but will 
   //finish before next overflow will take place
   ...
   .. 
   .
   //end of long operation
}


Thanks ahead.



List of 4 messages in thread
TopicAuthorDate
When does timer 2 get reloaded?            01/01/70 00:00      
   Another thing            01/01/70 00:00      
   read the manual            01/01/70 00:00      
   what is register bank 5 supposed to mean?            01/01/70 00:00      

Back to Subject List