Timer capture on p29 & p30

29 Mar 2010

Hi everyone,

I am looking to accurate measure the velocity of a motor and rather than use an analogue tacho would like to use an encoder. I could then time the distance between each pulse to get a really good idea of velocity over a large dynamic range (say 1 - 10000 RPM)

I think the way to go is by using the timer capture capability of the LPC1768 which are on pins 29 & 30 (see http://mbed.org/forum/mbed/topic/39/?page=1#comment-159) but this is about a much as I know. I also need to have this running in the background and am a bit worried that it might interfere with long printf statements etc. When a pulse from the encoder is recieved on a pin I just want to sample the timer then reset it. 

Can anyone point me in the right direction on using timer capture in this manner?