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
Trying to do this with a microcontroller may already be the wrong approach. Analog tools may well be cheaper --- I suspect some power plants out there still use mechanical tuning forks for this. That said, if you really want to do it using a micro, counting alone won't do it. You have to measure the duration of a certain number of cycles and do a division, instead. E.g. generate a zero-crossing signal, wire that to an interrupt input, and count for, say, 50 cycles. Have a second counter running free at a fixed frequency (CPU clock divided by something suitable, or an external reference oscillator). Start it on the first of those 50 cycles, and stop it after the last. Read it out, and you have the time taken for 50 cycles. Should be 1 second. The difference is your measurement.