I am reading an encoder for velocity and I would like to calculate the speed using the encoder pulse width.
I have tried doing this using an External Interrupt INT_EXT to start timer 1
but couldn't work out how to stop the timer on the falling edge so that the count relating to pulse width (and hence velocity) could be read.
Of course if the shaft isn't moving it will also need to cater for this and time out within 1 second for example.
Any help would be appreciated -
Rob
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Mon Dec 14, 2009 11:18 am
The CCP (in capture mode) is designed to do this.
CCS has an example file which uses both CCP modules to do it:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum