Page 1 of 1

Clock divider setting for 0-300Hz?

Posted: Mon Jul 29, 2013 10:38 am
by GTIspirit
What's the best clock divider setting to read in a frequency signal that's on the order of 0 to 300Hz? "CLOCK / 128" or "CLOCK / 1024"?

Signal in question is a vehicle speed signal that reads 16Hz when stationary and on the order of 130Hz at nearly 75mph. Not that my 1987 GTI 16V will ever do 150mph, but 0 to 300Hz is a good estimate of the working range with room to spare.

P.S. "CLOCK / 128" seems to be the best setting for the rpm signal on my car, which is say 700 to 7500rpm, with two pulses per revolution, makes approximately 23 to 250Hz, so maybe "CLOCK / 128" was a good guess for my vehicle speed signal.

Posted: Mon Jul 29, 2013 4:36 pm
by brentp
Probably clock/128 . We have some work to do to extend the dynamic range of the timer - it's currently a 16 bit timer, but with some extra code we can extend it to 32 bits. this will increase the dynamic range at the lower end.

Posted: Thu Aug 01, 2013 12:27 am
by GTIspirit
brentp wrote:Probably clock/128 . We have some work to do to extend the dynamic range of the timer - it's currently a 16 bit timer, but with some extra code we can extend it to 32 bits. this will increase the dynamic range at the lower end.
That would be great! Because at Clock/128 the lowest frequency I can measure is 16Hz. And the scaling between Hz and mph is 0.575. (Guessing it should theoretically be 0.62, which would be 1Hz/1kph, those logical Germans;) but I have bigger tires than stock so a smaller multiplier makes sense.) It sure would be nice to measure lower than 9mph to get better data from an autocross start.

And when you increase the dynamic range, could you make so that when it reads below the lowest possible measurable value it shows 0, instead of the 16Hz that shows now. e.g. if the new dynamic range goes down to say 4Hz and can't measure below that, it should show 0Hz instead of 4Hz when the signal is less than 4Hz.

Posted: Thu Aug 01, 2013 12:28 am
by brentp
Hi Charles - Yes. Railing to zero when below the measurable value is on the list.

Thanks,