Using a fast timer, you should sense the amplitude of the sine wave. start from 0, then it should go up and again return to 0, then go to its negative values and finally back to 0.
Measure time which has passed, then the frequency is simple 1/time.
We have assumed that the sine wave has no DC offset.
We also assumed that the waveform is a pure sine wave.
For more general ways, you can use FFT. |