So, what's your hardware actually going to look like? How are you wanting to drive the pulse input from the wheel? IR? Beam-breaker? Hall effect?
When you can get a good pulse coming from the disk, you can time the difference between the pulses, 1st pulse starts the timer, 2nd pulse stops the timer, saves the value, code resets the timer/counter and awaits the 3rd (actually back to the 1st) pulse.
Use any 16 bit timer with a pre- and/or post -scaler.
Just as an example here...if the rpm gets too great, the pulses get too close together, less than 256 counts, you could turn down the prescaler (down to a point anyways) to make the timer 'more accurate' for those speeds.
If the rpm falls off, and you get close to maxing out the timer/counter, say above 50,000, and you could turn up the prescaler to make the timer 'less accurate'. The accuracy won't be changing, but the method in which you calculate the rpm will.





Bookmarks