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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/17/00 06:47
Read: times


 
#2713 - RE: TIMER2
Hi Kiki,

yes, T2 of the 552 is not identical to the 8052 timer T2 !
T2 should be used free running and can not be cleared
internally.
But you can work around with the capture/ compare functions.

1.
to measure times, you must capture at the beginning
and the end of the time interval.
Then you must only substract both values to get
the difference time (16 bit substraction).

2.
to generate exact defined timer interrupts
(without losing clocks)
you must use the compare interrupt.
And on every compare interrupt add the desiered
time interval to the compare value.
So on the next compare interrupt exact this
time interval was gone.
Clear then the interrupt flag to avoid
unexpected interrupts during this 16 bit addition.
Since temporarely a wrong compare value was
valid until the addition was completed.


Peter


List of 4 messages in thread
TopicAuthorDate
TIMER2            01/01/70 00:00      
RE: TIMER2            01/01/70 00:00      
I can't use TIMER2            01/01/70 00:00      
RE: I can't use TIMER2            01/01/70 00:00      

Back to Subject List