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. So, I need some way to generate and count a 1000 Hz pulse. How would I do that? One idea is, I could use a (16 bit) timer on a PIC (16 bit would allow for a 65 second count using a 1 KHz pulse) and count up (can a PIC timer count up (not down)?). I can use an external crystal for the timer and divide it down to 1000 Hz (can I divide an external clock signal down?). That way, once I have the timer counting at 1000 Hz, I can read and reset the timer every time the reed switch is pulsed. For example, if it takes 0.764 seconds for the wheel to spin once, the timer would read 764 just before being reset for the next count. I could use 2 magnets on opposite ends of the wheel for greater accuracy (and balance). Would this work? -- [ solarwind ] -- http://solar-blogg.blogspot.com/ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist