We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I was just got a basic doubt about timers. Is it possible to read 8051 timer register. one of the timer for example timer0 starts when an external event occurs and stops until the event is finished. Once the timer stops I need to read value of the timer to check the time taken for the event to take place. I cant use the timer in counter mode since I dont have any signal coming to pins P3^5, P3^4.
regards. Raghun
hi,
- timer0 starts when an external event occurs and stops until the event is finished
- I dont have any signal coming to pins P3^5, P3^4
So how do you detect that event? The main idea is: - configure timer at startup time, do not run it, clear timer registers; - wait till event comes in; - run timer; - wait till event finished; - stop timer; - read timer registers. Note: it event duration is more than timer overflow time then use timer overflow interrupt and increase overflow counter variable.
How to read -- look at datasheet about timer registers.
Regards, Oleg