On the rising edge of your square wave, start a timer running. When the next rising edge comes along, grab the timer count so you can calculate the period of the square wave, and reset the timer for the next go around.
If your waveform is symmetrical you could start the timer on the rising edge and stop on the falling edge and get your frequency in 1/2 cycle.
Maybe...
steve






Bookmarks