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
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.