Introduction
This is 60 MHz frequency meter / counter for measuring frequency from 10 Hz to 60 MHz with 10 Hz resolution. The meter provides very stable readings and has excellent input sensitivity thanks to on board amplifier and TTL converter, so it can even measure weak signals from crystal oscillators. With the addition of prescaller it is possible to measure the frequency of 1GHz and above.
The basic idea comes from the AN592 Microchip application note: "Frequency counter using PIC16C5x" where you may find a simple software wich implements a frequency counter using a PIC microcontroller.I wrote a specifically designed software to improve the counter resolution, to handle the IF mode and value by means of an operating menu, to decode and edit the read frequency on an LCD display. The result was a simple and effective device.
The electrical schematic is very simple, given that most of the functions are implemented by the microprocessor. It was needed only an amplifier stage to raise the input signal level from 200-300 mV p.p. to about 3 volts p.p. A self biased common emitter amplifier produces a pseudo-TTL driving signal. The 10uH inductor in the collector lead helps extend the high frequency response. Any "fast" NPN transistor should be suitable. I used a BFR91, but you may substitute a transistor scrounged from an old TV tuner or a VHF receiver.
| BFR 91 Transistor Front |
The amplifier's quiescent Vce is set to 1.8 to 2.2 volt by the resistor marked * on the diagram. It is nominally 10K, but you may need to change it. The collector voltage is applied to the PIC's counter/timer via a series 470 ohm resistor.The PIC is able to short this signal to ground via an internal pull-down transistor to disable counting.
The PIC implements a 32 bit counter, partly in internal hardware and partly in software. Counting is enabled by turning off the internal pull-down transistor for "exactly" 0.4 second. At the end of this time, the PIC divides the count by 4, then adds or subtracts the appropriate IF frequency to get the actual frequency. The resulting count is converted to printable characters and delivered
to the display.
PCB Design
Download Firmware and schematic
Click here to download
Calibrating : before use
Before the frequency meter will work properly, it must be calibrated. This may be as simple as connecting a known frequency source and adjusting the trimmer capacitor so the correct value is displayed. If you are unable to adjust the displayed frequency, then a "coarse calibration" is required. This involves starting with the power off. Pin 10 is connected to ground and the power is then turned on (and held on). The PIC will measure and display the input frequency, followed by the letters CAL. If you can't adjust the indicated frequency to the correct value (by adjusting the 33 pF trimmer), then coarse adjustments can be made by briefly connecting pin 12 or pin 13 to ground. It may take several tries, because the program only checks these pins once each measurement (0.4 second). Once you are happy with the adjustment, remove the ground from pin 10 (while power is still applied). This will cause the PIC to store the calibration in non volatile internal memory.
if you feel like an question just make a comment
PCB Design
Download Firmware and schematic
Click here to download
Calibrating : before use
Before the frequency meter will work properly, it must be calibrated. This may be as simple as connecting a known frequency source and adjusting the trimmer capacitor so the correct value is displayed. If you are unable to adjust the displayed frequency, then a "coarse calibration" is required. This involves starting with the power off. Pin 10 is connected to ground and the power is then turned on (and held on). The PIC will measure and display the input frequency, followed by the letters CAL. If you can't adjust the indicated frequency to the correct value (by adjusting the 33 pF trimmer), then coarse adjustments can be made by briefly connecting pin 12 or pin 13 to ground. It may take several tries, because the program only checks these pins once each measurement (0.4 second). Once you are happy with the adjustment, remove the ground from pin 10 (while power is still applied). This will cause the PIC to store the calibration in non volatile internal memory.
if you feel like an question just make a comment









Hi - Thanks for a great circuit :) - I would like to make the count update rate faster. The program will run at 20Mhz with a 16F84-20 PIC, but the displayed frequency is obviously 5x lower than it should be (eg a 50Hz input shows 10Hz). Do you have the ASM source code please so I can adjust the timing values ? - many thanks.
ReplyDeletehi richard
ReplyDeletei will send you the source code please send me you email id
Thank you
hi richard
ReplyDeletei have sended you the source code please
check you mail
Thank you
Can this project be modified to work with PIC16F877A?
ReplyDeleteAnd software have changed?
We have available this circuit and a display 16 * 1.
Can I projecting single PCB.
You can send me to the ASM code?
ReplyDeletevankov@inbox.ru
Hi - Thanks for a great circuit :) - I would like to make the count update rate faster. The program will run at 20Mhz with a 16F84-20 PIC, but the displayed frequency is obviously 5x lower than it should be (eg a 50Hz input shows 10Hz). Do you have the ASM source code please so I can adjust the timing values ? - many thanks.
ReplyDeletesory my english ....
This comment has been removed by the author.
ReplyDeleteI noticed the pcb layout does not match the schematic. Which is correct for the .HEX file?
ReplyDeleteSchematic
PIC6 - LCD11 - PCB11
PIC7 - LCD12 - PCB12
PIC8 - LCD13 - PCB9
PIC9 - LCD14 - PCB8
Also, could you send me the .asm source file as I can use it to verify which is the correct pinouts plus I would like to add voltage measurement to the code. rhodes[at]fnrf.science.cmu.ac.th Replace [at] with @
Thanks
hi
Deletethankx for your comment
but as u can see with the schematic the lcd pin 7,8,9,10 not connected to any where so what do is on the pcb side there is no drill holes for female burg strip
and so on lcd module only from pin 1 to 6 and 11 to 16 have male burg strip pin7 to 10 left empty .
you said PIC8 - LCD13 - PCB9 but when there is no drill on pcb side so no metal pin on female burg strip(i pulled out 4 metal pin with a pliers)and even on the lcd pin 7 to 10 male burg strip is not soldered.and you can see the PCB trace is going to lcd 13 ultimately .
i have personally tested it working fine.
if you still have any confusion ,feel free to ask.
Hi,
DeleteI use PIC16F84A-04P & LCD LMB162AFC, With the JDM programer is Successfull but I do not Anything in The LCD?
Regards,
SugengKisw
have you properly set the lcd contrast by that 10K pot
Deletei have never been used the LCD LMB162AFC i don't where it has same commands for interfacing
you should you HD44780 or LM016L display or any compatibly with them
Please provide the eagle PCB file
ReplyDeleteHello,
ReplyDeleteDoes the hex file work with PIC16f84A ?
Thanks,
regards,
Sugeng Kisw
yeah sure
DeleteI like it and could be nice quick troubleshooting tool...
ReplyDeleteI would like to take your effort and make a USB powered version - do you have any idea of current draw on 9V Battery ?
Also a copy of source code would make the USB conversion easier. Plan on using Windows/C++Builder for display instead of LCD.
Bob
Hi richard
ReplyDeleteCan you please sent me the ASM source code?
osmosis86@gmail.com
Thank you
Hi,
ReplyDeleteI made a mistake in wiring
Now it work,LCD LMB162AFC can be used for this Schematic. No Add anything.
Thanks you very much.
Regards,
Sugeng Kisw
Hi richard
ReplyDeleteCan you please sent me the ASM source code?
kahya.anil@gmail.com
Thank you
Can I get the asm code for few modifications
ReplyDeletethilinaprabath@gmail.com
Can you please sent me the ASM source code? tazn85@gmail.com thanks&verry good post
ReplyDeleteplz send me asm code tazn85@gmail.com
ReplyDeleteCan I get the asm code for few modifications
ReplyDeletegovindaylur@yahoo.com
Sir i need coding for PIC16F877A to this same circuit.
ReplyDeleterajendrnat1960@gmail.com
DeleteDear Mr. Gaurav Chaudhary.
ReplyDeleteI found very interesting your frequency meter
Do you have a tutorial that explains how do you get the precision and the accuracy of your project? I appreciate to study it.
Thank you.
Moris Alkabes
Congratulations for your design and thank you by publishing it, Gaurav Chaudhary. It works perfectly. It's very stable with frequency.
ReplyDeleteI would like to measure higher frequencies and I could read above that it's possible to get more than 1 GHz with prescaler but ..... is the software prepared to it or needs a diferent software?
Thanks in advance.
Gerardo U.
trifonc@yahoo.es
Sorry, I don't know the function of the jump in the pin 11 of the pic. What is it for? I read that jumps in Pin 10, 12 and 13 are for calibrating, but the pin 13?
ReplyDeleteThank again.
Gerardo
Hello Gaurav Chaudhary,
ReplyDeleteI really like your project and I just want to ask can I use your 16F84 hex file to program 16F84A?
Best regards!
Good day, can You send me the .asm file? kind.of.wolf@gmail.com
ReplyDeleteBest wishes.
Hi, this is a very well-done project ! Can you send me the source file? mattia.bond@hotmail.it
ReplyDeleteBest regards!
Hey
ReplyDeleteGood job.
Could you please send me the asm code of your project
akanksha8767@gmail.com
Thanks
Hi sir.....Thanks for the circuit.I would like to make the count update rate faster. The program will run at 20Mhz with a PIC16F840, but the displayed frequency is obviously 5x lower than it should be (eg a 50Hz input shows 10Hz). Do you have the source code for that? so I can able to calibrate the values? thanks.
ReplyDeletesource code please
ReplyDeletezubusha@yahoo.com
Hi richard
ReplyDeleteCan you please sent me the ASM source code?
My id is
ms23.sidhu@gmail.com
Thank you
hi, Sourcecode will let me learn this better. my email. sambomg@gmail.com
ReplyDeletethanks for good project
Hi....Thanks for the circuit. But i want to learn about this better. So, Could you sent me the ASM source Code.
ReplyDeletemy email: ervan.erry@gmail.com
thanks you
Hi, i'm a student registered for electrical engineering. Am doing my final year design project. Could you please send me via email the ASM code of your project. Please help, the deadline is against me for design proposal. my email: thobekani.khumalo@gmail.com. Your help would be highly appreciated.
ReplyDeletethanks
Nicholas khumalo
hi, thanks for your perfect project, but let me learn more about this.
ReplyDeleteso i hope you sent me the ASM sour code,
email : magfurramdhani@gmail.com
email : magfur.ramdhani@yahoo.com
thanks before ^_^
please sent me the source code, it will make me easy to learn,,
ReplyDeletemy email : magfur.ramdhani@gmail.com
thanks before.. ^_^
hi,
ReplyDeleteGreat to see frequency counter using 16f84.for my project i want to make a Frequency Counter using the 16f84.
please can u send me the source code, It will be useful for me
thanks in advance
mail id:go4mothi@gmail.com
kind regards
mothilal
hi i just built the circuit..It works fine but does not show the frequency for 32MHZ..CAN ANYONE HELP..THANKS...
ReplyDeleteThank you for your hard work. Please send me the ASM code.
ReplyDeletekshgunawardena@gmail.com
Sir
ReplyDeleteMy eamil ID: abhinavjain001@gmail.com
can u send me your code, i'm having trouble with a project and i need a frecuencymeter, this will be useful thanks
ReplyDeletenicoft@me.com
can you send me the asm source code and if possible css pic c source code to tcruise7771@hotmail.com
ReplyDeleteHello, I am a student of electrical engineering registration. Project is to design my final year. Can you please send me an email through the ASM code of your project. Please help
ReplyDeleteemail: dinhduy.kk@gmail.com thanks!
Hi, i'm a student registered for electrical engineering.Am doing my final year design project. Could you please send me via email the ASM code of your project.Please help. email: dinhduy.kk@gmail.com thanks!
ReplyDeleteI notice that you say your circuit can be set for specific IF frequencies.
ReplyDeleteWould I be right in thinking this involves the use of pins 11, 12 and 13 to allow the PIC to measure an offset frequency, store it and then add/subtract it from the actual input to pin A4?
Could you clarify this point please?
Thank you