Hi, every body ...
There's a small failure in the problem ...
Let's see the original code : it is intended to be one pulse every wheel turn; let's assume speed is 36 km/h ...good speed no ?
that gives 10 m/s; as the wheel diameter is 500 to 700 mm, that makes a maximum of 1.5 m per rev.
so, maximum pulse freq. is 6Hz ...as PBP works with integers, that makes 7 different speeds to display !!!
Yeah, you've understood ... that is the period of rotation to be measured and converted further to speed. not the number of pulses to be counted.
So you need a time counter to run and to be read every pulse, I think then a 16F84 is not the right processor to have a separate free running timer in the backwards ...
and as the timer has to count roughly to 1.5 seconds ... interrupts will be really busy ...
Honestly, I don't have the solution for that ...with a 16F84.
Alain
Bookmarks