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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/04/01 12:31
Read: times


 
#13022 - RE: Using timers 0&1 problem
Hi Jacek,

again, your code was not fully wrong. I miss only the right detection of the start and the stop point.
Thus, why you get wrong results.

Please make a plan like this:

- first 1-0 transition: start T0
- first 0-1 transition: stop T0, start T1
- second 1-0 transition: stop T1
- read T0
- read T1

You can see, that your routine not meet this scheme, since:

A transition triggerd interrupt was not served immediately after the transition, if disabled. So enabling 1 year later causes, that it was also served 1 year later.
Thus a typical enabling sequence was:

clr IE0 ;reset, if it was already set on earlier trigger events
setb EX0 ;enable to detect the next trigger event

Also all other interrupts should be enabled in this way. Since in most cases it was not desired to serve events, which happens long time ago.



Peter


List of 7 messages in thread
TopicAuthorDate
Using timers 0&1 problem            01/01/70 00:00      
RE: Using timers 0&1 problem            01/01/70 00:00      
RE: Using timers 0&1 problem            01/01/70 00:00      
RE: Using timers 0&1 problem            01/01/70 00:00      
RE: Using timers 0&1 problem            01/01/70 00:00      
RE: Using timers 0&1 problem            01/01/70 00:00      
RE: Using timers 0&1 problem            01/01/70 00:00      

Back to Subject List