i think the freuency u mean is depend on ur assembly program...
firstly, u should have a ADC to convert ur analogue freq. to digital for 8031 uP to trace the point, after that is u to write a softcode to trace the time for waveform point from 1 max point (peak) to the other max point(peak)...