> To get accurate speed readings for my bicycle speedometer > project, I have to count how long it will take the wheel to turn > rather than how many times it has turned in x seconds. I want > a 1 second speed update rate so to go about it, I need to count > how many milliseconds it takes for the wheel to spin once. > That way, I can get an accurate speed reading. A 32 bit free running counter over the prescaler giving 10KHz. On sensor event store the counter's value. Store last 4 values. That's it. On a display interrupt get the difference between first and 4th values, that is total time span for the last 3 rotations, calculate and show the speed. And, please, don't ask how to organize a 32 bit free running counter, what's prescaler, why you need an interrupt to display the result etc. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist