Convert the frequency to a logic level pulse train. Use a pin as an input and use the pulses to count up a value. If you can control the counting period accurately, then the accumulated count scales to frequency.
basically, there are no constraint on PIC used. but preferable is PIC16F84, or PIC16F877. So after i googling, i found that some algorithm such as autocorreration, Cepstrum analysis can detect the pitch. does that mean that i need to use them?
sgtwookie:
i thought frequency counter is to display the frequency of the device input, but what i wish to do is input voice signal into microphone and after process by PIC somehow then display it on LCD.
A bandpass filter will be needed after the microphone to pass only the required pitch. Then a copmarator will monitor when the output signal of the filter passes through its bias point and produce pulses. As mentioned in the previous answers, you can count the pulses per a unit of time and calculate the signals frequency. If you know how to implement the filtering and comparison digitally, you can use a DSP PIC and reduce the components of the circuit.
Audio pitch detection on a small pic is going to be unlikely. There are so many harmonics which makes most methods very tricky. Heavy filtering will work for a narrow range (less than an octave). This is really a PC application although it is possible a DSPic might manage it. The programming will be hard though. I believe a fast fourier transform may be a possible option.