This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Frequency Meter

Hi,
I want to develop a frequency meter with a resolution of .01 Hz. I am using 89c51 and a 12Mhz clocker. Kindly let me know how to do it. Thanks

Parents
  • 0.01 Hz is a period of 10ms which is a long time to a microcontroller. A simple solution might be to have an interrupt running periodically with a period of (say) 1ms and use a bit of software to increment a 32-bit counter.

    For continuous sampling, you will need to at least double-buffer the results. When the count is complete, you could trigger another interrupt internally or set a flag that will be checked on a round-robin basis.

    This will consume significant processor resources, but if you are careful this should not be a problem. The main advantage of this approach is its simplicity. You might also want to take the opportunity to do some filtering such as removing glitches - much easier this way.

    A 10ms interrupt period could still reliably give you the required resolution if you add some simple digital filtering such as taking the mean of 10 consecutive samples.

Reply
  • 0.01 Hz is a period of 10ms which is a long time to a microcontroller. A simple solution might be to have an interrupt running periodically with a period of (say) 1ms and use a bit of software to increment a 32-bit counter.

    For continuous sampling, you will need to at least double-buffer the results. When the count is complete, you could trigger another interrupt internally or set a flag that will be checked on a round-robin basis.

    This will consume significant processor resources, but if you are careful this should not be a problem. The main advantage of this approach is its simplicity. You might also want to take the opportunity to do some filtering such as removing glitches - much easier this way.

    A 10ms interrupt period could still reliably give you the required resolution if you add some simple digital filtering such as taking the mean of 10 consecutive samples.

Children
No data