Content originally posted in LPCWare by elef on Wed Mar 21 05:02:43 MST 2012
Hi,
Regarding Timer32 on the LPC111x family, is there a way when an external capture occurs, for the timer to be reset?
i am trying to measure time between pulses. Each time i enter the interrupt routine, i reset TC (but obviously i am losing clock cycles from the time the capture occurs, until the reset code is executed in the interrupt).
I realise i can use a free running timer and subtract the previous read caputre value from the current capture value, but I prefer not to do this, as i am using match register functions to do certain other things, which will interfere with a free running timer. Doing it this way also requires more code to deal with when the timer "rolls over" at the end.
Any ideas? did i miss something in the manual? or is there a better way to do this? All i need to do is measure time between continuous pulses. Very similar to PWM demodulation, except i only want the frequency, not the pulse width, so i am only reading rising edges, ignoring the falling edges.
Thanks.