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.
I want to count time between two rising edge of TTL Pulses. For that I am using Timer0 & Timer1.
Timer0 is generate interrupt at every 20ms. In Timer0 ISR I start GPIO Interrupt. In GPIO ISR I start Timer 1. here I also disable GPIO Interrupt.
When next rising Edge is coming on Port I disable Timer1.
But I have problem with calculate the Time of Timer1.. Here I take value of T1TC and try to calculate time. but I not got success in it. T1TC give hex or integer value????....
Also I am used PLL Clock for ARM. My ARM processor is LPC2378. For calculate the count which register I can use (T1TC ya T1PC) ????
Please Help me??????
Of course, the timer registers are integer values. They are not floating point. And the values are never hexadecimal/binary/decimal/octal/... They are just integer numbers. These numbers will become hexadecimal if you decide to print them formatted as hexadecimal - the numeric base is just how you present an integer value. That the processor uses binary values to represent state information internally isn't something you have to think too much about, except when it comes to binary manipulation of values (logic and/or/...), numeric overflow (max range) etc. But when you read out the value 117 from a register, your source code would then manipulate the value 117 even if the processor would have been strange enough that it had managed to work with 16 values (hexadecimal) for each memory cell, instead of just the binary values 0 and 1.
The T1PC is a prescaler, that you use - togheter with the peripherial clock, to make the T1TC count at a specific frequency. So you normally just take the new T1TC value minus the previous T1TC value (as unsigned integers) while taking care that the measured period isn't long enough that you get one or more overflows.
There are a lot of examples available about how to configure the timer to tick at a specific frequency. If you do configure it to step T1TC at 1MHz, then you will get microsecond resolution when sampling the T1TC register.
Thanx..