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
Ya timer0 registers can be read & written like any register, TH0, TL0, The value can be moved to accumulator or R1, B.. using mov A, TH0 and accessed from there. If T1, T0 pins not working, could try Tx thru pin3.1 ie via SBUF to PC, could o/p to port 1 or 2 onto LED or any other o/p device.
Rgds, Hems.
it's "bible time" your question indicates a lack of BASIC knowledge about the '51. Such can be achieved by studying "the bible"
Erik here are the links to "the bible" Chapter 1 - 80C51 Family Architecture: www.nxp.com/.../80C51_FAM_ARCH_1.pdf
Chapter 2 - 80C51 Family Programmer's Guide and Instruction Set: www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf
Chapter 3 - 80C51 Family Hardware Description: www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf
Erik is right, So lets review the basics Raghun, Till then, does somebody care about the organization resources being NOT utilized...(or rather wasted)
"does somebody care about the organization resources being NOT utilized"
What on earth does that mean??
The org. on earth where somebody is working in
"something wrong said?"
I don't know if you said anything wrong because I didn't understand it.
I guess "The organisation on earth where someone is working in" means their "Workplace"? but have no idea why you wonder if their resources are not utilised
"no idea why you wonder if their resources are not utilised"
Nor what relevance it has here!
"... does somebody care ..."
You care or you wouldn't have bothered to ask.
Erik is right, (suggesting "bible time") So lets review the basics Raghun, Till then, does somebody care about the organization resources being NOT utilized...(or rather wasted)
SO, if i read correctly, what you are saying is that if somebody does not understand the basics of a '51 he should blindly copy and ask simple questions, because if he does not forget all about understanding what he is doing and blindly copy software from the net "resources are wasted"
Erik
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