PIC Mono-Frequency Analyzer

Discussion in 'The Projects Forum' started by altachlo87, Jan 18, 2010.

  1. altachlo87

    Thread Starter New Member

    Jan 17, 2010
    To seniors,

    I've been given a project of making a mono-frequency analyzer (frequency counter) of input range 1kHz - 100kHz.

    I'm thinking of using a Microchip PIC model 16F874/877A to analyze the input waveform. The input would be a +/-15V AC voltage.

    The analyzed frequency would shown on a LCD screen. Furthermore, there will be 4 output pins which the user should define their ranges of frequency (e.g: pin1: 1k~25kHz, pin2: 25kHz~50kHz,...), If the detected frequency falls into 1 of the 4 range pins, the relevant pin would be "ON", otherwise would give nothing. (e.g. detected 45kHz; pin2 ON)

    My questions:
    (1) Is PIC16F877A suitable for the job?

    (2) As for the frequency analyze part, my senior told me that the internal clock inside the PIC would do the comparison with the input signal, but i thought an external crystal clock would do the job, is a crystal necessary?

    (3) I'm using MPLab.IDE to write the program code, but i don't know if the b/w LCD screen/keypad would be compatible with the program, is there any way i could know if a new LCD screen/keypad (haven't buy) can be recognisable by the program, or is there any special command/program for the screen/keypad?

    (4) Other than using a 12-buttons keypad, is there any other possible way which can be used for the same purpose but simpler programming code?
    This is because my senior told me that the program for 12-buttons matrix keypad is quite complicated.

    Thanks a lot for any help/suggestions/ideas!
  2. JDT

    Well-Known Member

    Feb 12, 2009
    (1) Yes! Perfect!

    (2) An external crystal (or crystal oscillator) is needed for accuracy, as your readings will depend on this.

    (3) MPLab will not know anything about an external keypad or display module. You have to write the code to use these. If you use a typical multi-line LCD display there is lots of example code available.

    (4) A BCD thumbwheel switch bank is probably the easiest way to input a number. A keypad is nicer.

    All the work in this project is communicating with the display and reading the keypad. The frequency counter part is easy using the internal timer/counters. Not a beginners PIC project. Expect to take some time doing this!