I am using a timer FC1 with device TMP10 to generate a 2mS interrupt and it works fine. I now need to use a second counter (maybe FC2) to measure the time it takes for an external input to trigger the on-chip comparator. In the Comparator ISR I need to stop the timer and read the timer value (16-bit). In real time the comparator should trigger anywhere from a few 10s of uS to a few hundreds of uS. However, Component Inspector asks for a period/offset value, which I don't think I need. which timer and clock source should I use?
Solved! Go to Solution.
Hi Julian,
then there are the FreeCntr8, 16 and 32bit components you can use:
Erich
Perhaps I should simplify my question. I need to start a 16-bit timer clocked at about ~4...5Mhz, stop it and read the time - thats basically it - no interrupts, no compare, nothing else - just start, count, stop, read.
Hi Julian,
use the TimerUnit_LDD:
Enable/Disable starts/stops the counter. ResetCounter is used to set it back to zero, and with GetCounterValue you get the counter register value.
Set your timer frequency with interrupts disabled.
Voilà :-).
I hope this helps,
Erich
Hi Erich,
Thanks for your reply, but this looks like deja vu. Your reply looks very much like a solution for an ARM device. However, I omitted to specify (again) that I am using a S08QE and a S08SH processor. Sorry to have wasted your time.
Hi Julian,
then there are the FreeCntr8, 16 and 32bit components you can use:
Erich
Thank you for your help. I looked at a that before but there was no "GetTicks" option. I eventually found it when I clicked on the "Advanced" option in the Component Inspector window.