Updated Frequency Meter





Here is an updated version of the Digital Frequency Display published in AR in September 2002. Since then I have learned quite a bit about PIC programming and, with inspiration from a Web page by IK3OIL, have managed to perform all counting functions "on chip".


This version features a much simpler front end, an extended frequency range and a coarse calibration function implemented in software. It retains the ability to add or subtract one of three IF offsets, making it suitable as a frequency display for a direct conversion or superhet receiver (also for transmitters using "on frequency" VFOs or using mixing). Resolution remains at 10Hz and accuracy is in the order of 100Hz.


How it works:



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. 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. It is crude, but quite effective.

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.

Setting up!

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.

Normally pin 10 is floating at turn on, but may be grounded later to "program" the Intermediate frequency offsets. The next few paragraphs, copied (with amendments) from the September 2002 article describe how this is done.

To program the intermediate frequencies, connect the BFO to the the counter then set up the PIC as follows:
Ground pins 12 and/or 13 of the PIC to select one of three IF offsets. Pin 12 when pulled low, indicates the BFO is on its lower frequency. Pin 13 when pulled low, indicates the BFO is on its higher frequency. Alternatively, you can pull both pins 12 and 13 low to use the third offset. If both pins 12 and 13 are left floating, the PIC will not actually store anything!

To store the measured BFO in the selected internal EEPROM, just ground pin 10 of the PIC for at least 0.5 second, then release it.

For normal operation, the RF input of the counter is connected to the receiver VFO and the PIC uses the stored IF offsets to calculate the actual frequency. If neither BFO selection pin (12 and/or 13) is pulled low, the PIC uses the average BFO frequency. If no IF offset is required, just measure and store 0Hz for both offsets. Alternatively, you can pull both pins 12 and 13 low to use the third offset (which must also be programmed to 0Hz.)

Pin 11 when held low, indicates that the selected IF is to be added to the measured VFO frequency to give the indicated frequency. If pin 11 is floating, then a subtraction is done (VFO-IF or IF-VFO, whichever is appropriate).

Some LCD displays are configured as "8 character by 2 line" but with all the characters displayed on the one line. To cater for these displays, the PIC tests pin 18 occasionally. If it finds this pin grounded, it it inserts a "move to line 2" command after the eighth character. If your display only shows eight characters, then try grounding pin 18 of the PIC.

Getting the software:

Click this link for the assembler source code! And, for the "assembler challenged" here is the hex code!
And for your complete diversion from the project, here is a programmer to blast the HEX code into the PIC.

The last word:

This frequency meter has much simpler hardware than the 2002 version and because of "improvements" in the software (32 bit counter instead of 24) has a higher frequency limit. The 2002 frequency meter was hard limited to 41.94303 MHz. This one exceeds 50 MHz, limited only by the PIC's counter/timer. The prototype was still counting reliably at 60+ MHz.


Adding a Prescaler

Click here for information on adding a prescaler.

No comments:

Post a Comment

Labels

PROJECTS 8086 PIN CONFIGURATION 80X86 PROCESSORS TRANSDUCERS 8086 – ARCHITECTURE Hall-Effect Transducers INTEL 8085 OPTICAL MATERIALS BIPOLAR TRANSISTORS INTEL 8255 Optoelectronic Devices Thermistors thevenin's theorem MAXIMUM MODE CONFIGURATION OF 8086 SYSTEM ASSEMBLY LANGUAGE PROGRAMME OF 80X86 PROCESSORS POWER PLANT ENGINEERING PRIME MOVERS 8279 with 8085 MINIMUM MODE CONFIGURATION OF 8086 SYSTEM MISCELLANEOUS DEVICES MODERN ENGINEERING MATERIALS 8085 Processor- Q and A-1 BASIC CONCEPTS OF FLUID MECHANICS OSCILLATORS 8085 Processor- Q and A-2 Features of 8086 PUMPS AND TURBINES 8031/8051 MICROCONTROLLER Chemfet Transducers DIODES FIRST LAW OF THERMODYNAMICS METHOD OF STATEMENTS 8279 with 8086 HIGH VOLTAGE ENGINEERING OVERVOLATGES AND INSULATION COORDINATION Thermocouples 8251A to 8086 ARCHITECTURE OF 8031/8051 Angle-Beam Transducers DATA TRANSFER INSTRUCTIONS IN 8051/8031 INSTRUCTION SET FOR 8051/8031 INTEL 8279 KEYBOARD AND DISPLAY INTERFACES USING 8279 LOGICAL INSTRUCTIONS FOR 8051/8031 Photonic Transducers TECHNOLOGICAL TIPS THREE POINT STARTER 8257 with 8085 ARITHMETIC INSTRUCTIONS IN 8051/8031 LIGHTNING PHENOMENA Photoelectric Detectors Physical Strain Gage Transducers 8259 PROCESSOR APPLICATIONS OF HALL EFFECT BRANCHING INSTRUCTIONS FOR 8051/8031 CPU OF 8031/8051 Capacitive Transducers DECODER Electromagnetic Transducer Hall voltage INTEL 8051 MICROCONTROLLER INTEL 8251A Insulation Resistance Test PINS AND SIGNALS OF 8031/8051 Physical Transducers Resistive Transducer STARTERS Thermocouple Vacuum Gages USART-INTEL 8251A APPLICATIONs OF 8085 MICROPROCESSOR CAPACITANCE Data Transfer Instructions In 8086 Processors EARTH FAULT RELAY ELECTRIC MOTORS ELECTRICAL AND ELECTRONIC INSTRUMENTS ELECTRICAL BREAKDOWN IN GASES FIELD EFFECT TRANSISTOR (FET) INTEL 8257 IONIZATION AND DECAY PROCESSES Inductive Transducers Microprocessor and Microcontroller OVER CURRENT RELAY OVER CURRENT RELAY TESTING METHODS PhotoConductive Detectors PhotoVoltaic Detectors Registers Of 8051/8031 Microcontroller Testing Methods ADC INTERFACE AMPLIFIERS APPLICATIONS OF 8259 EARTH ELECTRODE RESISTANCE MEASUREMENT TESTING METHODS EARTH FAULT RELAY TESTING METHODS Electricity Ferrodynamic Wattmeter Fiber-Optic Transducers IC TESTER IC TESTER part-2 INTERRUPTS Intravascular imaging transducer LIGHTNING ARRESTERS MEASUREMENT SYSTEM Mechanical imaging transducers Mesh Current-2 Millman's Theorem NEGATIVE FEEDBACK Norton's Polarity Test Potentiometric transducers Ratio Test SERIAL DATA COMMUNICATION SFR OF 8051/8031 SOLIDS AND LIQUIDS Speed Control System 8085 Stepper Motor Control System Winding Resistance Test 20 MVA 6-digits 6-digits 7-segment LEDs 7-segment A-to-D A/D ADC ADVANTAGES OF CORONA ALTERNATOR BY POTIER & ASA METHOD ANALOG TO DIGITAL CONVERTER AUXILIARY TRANSFORMER AUXILIARY TRANSFORMER TESTING AUXILIARY TRANSFORMER TESTING METHODS Analog Devices A–D BERNOULLI’S PRINCIPLE BUS BAR BUS BAR TESTING Basic measuring circuits Bernoulli's Equation Bit Manipulation Instruction Buchholz relay test CORONA POWER LOSS CURRENT TRANSFORMER CURRENT TRANSFORMER TESTING Contact resistance test Current to voltage converter DAC INTERFACE DESCRIBE MULTIPLY-EXCITED Digital Storage Oscilloscope Display Driver Circuit E PROMER ELPLUS NT-111 EPROM AND STATIC RAM EXCITED MAGNETIC FIELD Electrical Machines II- Exp NO.1 Energy Meters FACTORS AFFECTING CORONA FLIP FLOPS Fluid Dynamics and Bernoulli's Equation Fluorescence Chemical Transducers Foil Strain Gages HALL EFFECT HIGH VOLTAGE ENGG HV test HYSTERESIS MOTOR Hall co-efficient Hall voltage and Hall Co-efficient High Voltage Insulator Coating Hot-wire anemometer How to Read a Capacitor? IC TESTER part-1 INSTRUMENT TRANSFORMERS Importance of Hall Effect Insulation resistance check Insulator Coating Knee point Test LEDs LEDs Display Driver LEDs Display Driver Circuit LM35 LOGIC CONTROLLER LPT LPT PORT LPT PORT EXPANDER LPT PORT LPT PORT EXTENDER Life Gone? MAGNETIC FIELD MAGNETIC FIELD SYSTEMS METHOD OF STATEMENT FOR TRANSFORMER STABILITY TEST METHODS OF REDUCING CORONA EFFECT MULTIPLY-EXCITED MULTIPLY-EXCITED MAGNETIC FIELD SYSTEMS Mesh Current Mesh Current-1 Moving Iron Instruments Multiplexing Network Theorems Node Voltage Method On-No Load And On Load Condition PLC PORT EXTENDER POTIER & ASA METHOD POWER TRANSFORMER POWER TRANSFORMER TESTING POWER TRANSFORMER TESTING METHODS PROGRAMMABLE LOGIC PROGRAMMABLE LOGIC CONTROLLER Parallel Port EXPANDER Paschen's law Piezoelectric Wave-Propagation Transducers Potential Transformer RADIO INTERFERENCE RECTIFIERS REGULATION OF ALTERNATOR REGULATION OF THREE PHASE ALTERNATOR Read a Capacitor SINGLY-EXCITED SOLIDS AND LIQUIDS Classical gas laws Secondary effects Semiconductor strain gages Speaker Driver Strain Gages Streamer theory Superposition Superposition theorem Swinburne’s Test TMOD TRANSFORMER TESTING METHODS Tape Recorder Three-Phase Wattmeter Transformer Tap Changer Transformer Testing Vector group test Virus Activity Voltage Insulator Coating Voltage To Frequency Converter Voltage to current converter What is analog-to-digital conversion Windows work for Nokia capacitor labels excitation current test magnetic balance voltage to frequency converter wiki electronic frequency converter testing voltage with a multimeter 50 hz voltages voltmeter

Search More Posts

Followers