jinx
11-28-05, 04:25 AM
Hi,
Sorry if this sounds like an extremely naive request. I just want to set up a ServoPod USB timer so that it starts counting when I initialise it and then I want to read the count whenever I have to and then zero it out and reinit it to count again.
Basically I want to measure the time between when I take samples from my quadrature decoder, which I have set up using QUAD0. I need this to compute the angular velocity from the position differences.
I've seen a lot of sample code in the forums which deals with timers to capture and count pulse widths, rising/falling edges etc. What I was actually looking for is just a simple code/macro which will set up a timer in the simplest mode (just incrementing on each system clock tick) and which I can read the count from program and which I can then reset to start counting again, ad infinitum.
If anyone has an example of setting such a (single-shot?) timer up or can point me to a place which does, I'll be extremely grateful.
Thanks again,
Jinx.
Sorry if this sounds like an extremely naive request. I just want to set up a ServoPod USB timer so that it starts counting when I initialise it and then I want to read the count whenever I have to and then zero it out and reinit it to count again.
Basically I want to measure the time between when I take samples from my quadrature decoder, which I have set up using QUAD0. I need this to compute the angular velocity from the position differences.
I've seen a lot of sample code in the forums which deals with timers to capture and count pulse widths, rising/falling edges etc. What I was actually looking for is just a simple code/macro which will set up a timer in the simplest mode (just incrementing on each system clock tick) and which I can read the count from program and which I can then reset to start counting again, ad infinitum.
If anyone has an example of setting such a (single-shot?) timer up or can point me to a place which does, I'll be extremely grateful.
Thanks again,
Jinx.