- #1
Sparkypedia
- 15
- 0
Hi
i am doing a side project of displaying RPM speed on the Altera development board DE0 which i have running at 10MHZ.
i have got a digital input from a hall effect sensor that has a frequency range from 1.6 to 166.6 Hz.
the signal incoming has a duty cycle of 50%
to calculate the RPM so far the RPM limits of 100rpm to 10000rpm have been converted to RPS by dividing by 60 which has given the above frequencies.
to calculate the time taken i an polling this pin, when is changes to a logic level high the time-stamp of the processor is recorded, from here every tick (clock cycle) is counted up until the signal returns to a logic level low the amount of tick counts is stopped and stored as a variable.
from this value how do i calculate the RPM, thoughts so far have been to divide this value by the CPU frequency (10MHz) to give Hz and then multiply by 60 to give RPM, but I am am not sure if this is correct.
all help with this issue greatly appreciated
i am doing a side project of displaying RPM speed on the Altera development board DE0 which i have running at 10MHZ.
i have got a digital input from a hall effect sensor that has a frequency range from 1.6 to 166.6 Hz.
the signal incoming has a duty cycle of 50%
to calculate the RPM so far the RPM limits of 100rpm to 10000rpm have been converted to RPS by dividing by 60 which has given the above frequencies.
to calculate the time taken i an polling this pin, when is changes to a logic level high the time-stamp of the processor is recorded, from here every tick (clock cycle) is counted up until the signal returns to a logic level low the amount of tick counts is stopped and stored as a variable.
from this value how do i calculate the RPM, thoughts so far have been to divide this value by the CPU frequency (10MHz) to give Hz and then multiply by 60 to give RPM, but I am am not sure if this is correct.
all help with this issue greatly appreciated