Ross Myers

Tacho output using TIM08

Discussion created by Ross Myers on Dec 10, 2007
Latest reply on Dec 11, 2007 by Ake Webjorn
Hi all,
Just after some ideas on the best way to approach generating a pulse signal from the Timer that could be fed into something like an Automotive Tacho to display RPM.
Just loading the Timer in OC mode with values would work fine, but I can't seem to figure the maths behind setting up the Timer prescalers (from 8MHz XTAL) to get the right range of pulse times.
Below is some examples of RPM values for an 8 cylinder 4 stroke (hope I got them correct!).
100 RPM =   400 Pulses /60 for 6.666Hz  (150 mSec)
1000 RPM =  4000 Pulses/60  for 66.66Hz  (15.000 mSec)
1001 RPM =  4004 Pulses/60 for 66.73Hz  (14.985 mSec)
10000 RPM = 40000 Pulses/60 for 666.6Hz  (1.5 mSec)
10001 RPM = 40004 Pulses/60 for 666.73Hz (1.49985 mSec)
Anyone got any suggestions please?