Frequency Counter 0-1 GHz

Sunday, April 30th, 2017 - Electronic Tools

Frequency counter circuit 0 – 1GHz made ​​using the PIC16F84A as frequency counters. Frequency counter circuit is capable of measuring frequencies from 0.0 Hz to 999.9 MHz with a resolution of 0.1 MHz. As a viewer to gauge the frequency of use 7 segment 4 digit controlled multiplex. Input to the frequency counter using a voltage divider prescaler SAB6456 and configuration with 2 pieces of diodes D1 and D2 before entering the prescaler SAB6456.

Circuit Of Frequency Counter 0-1 GHz

Frequency Counter 0-1 GHz, a frequency counter, frequency counter circuit, PIC16F84 frequency counter, frequency meter, making the tool uku frequency, calculate the frequency, the frequency of the program counter, program the frequency counter, frequency counter VHF, UHF frequency counter, frequency counter circuit UHF , 1GHz frequency counter, PIC16F84

Specifications Of Frequency Counter 0-1 GHz

  • Display range: 0.0 to 999.9 MHz, 0.1 MHz resolution
  • Correct rounding, reduced blinking of last digit
  • Over-range indication
  • Fast measurement – short measuring period
  • High input sensitivity in VHF / UHF band
  • Switchable intermediate frequency offset for use with receiver

PIC16F84A Program For Frequency Counter 0-1 GHz

LIST P=PIC16F84A
include __CONFIG _CP_OFF & _WDT_ON & _PWRTE_ON & _XT_OSC
;CONFIG B’11111111111101′ ;XT osc., WDT onTMR EQU 01h
PORTA EQU 5
PORTB EQU 6
INTC EQU 0Bh
TRISA EQU 85h
TRISB EQU 86h
STATUS EQU 3
OPTN EQU 81h
PROGCNT EQU 02h
W EQU 0
F EQU 1
C EQU 0
Z EQU 2
CNTW EQU 0Ch
CNT1 EQU 0Dh
CNT2 EQU 0Eh
CNT3 EQU 12h
CNT4 EQU 10h
DIGIT0 EQU 11h
DIGIT1 EQU 0Fh
DIGIT2 EQU 17h
DIGIT3 EQU 14h
WORKA EQU 15h
CNT5 EQU 16h
CNT6 EQU 13hBUFF0 EQU 19h
BUFF1 EQU 1Ah
BUFF2 EQU 1Bh
BUFF3 EQU 1ChBSF STATUS,5
MOVLW B’00010000′ ;RA4 input
MOVWF TRISA
MOVLW B’00000001′ ;RB0 input
MOVWF TRISB
MOVLW B’01110011′ ;prescaler & pull-ups
MOVWF OPTN
BCF STATUS,5CLRF DIGIT2
CLRF DIGIT1
CLRF DIGIT0
BSF DIGIT0,3
DECF DIGIT1
DECF DIGIT2
MOVF DIGIT1,W
MOVWF PORTA
BSF DIGIT0,2
CLRF DIGIT3
BCF DIGIT1,1
BCF DIGIT1,5
INCF DIGIT0
BSF DIGIT3,3
INCF DIGIT3
BCF DIGIT2,7
BCF DIGIT2,1COUNT CLRF TMR
CLRF CNTW
BCF INTC,2
CLRF CNT2CALL REFRESH
CALL REFRESH
CALL REFRESH
CALL REFRESHREAD MOVF TMR,W ;read from TMR0
MOVWF CNT1
BTFSS CNT1,7 ;is TMR>127?
GOTO READ2 ;no
GOTO READ3 ;yes
READ2 BTFSC INTC,2
INCF CNT2
READ3 MOVF CNTW,W
ADDWF CNT2
INCF CNT1
BTFSC STATUS,Z
INCF CNT2CONVST BTFSC PORTB,0 ;*** IF frequency correction? ***
GOTO CONV01 ;NO
;YES
MOVLW 0xD6 ;= 20 * (IF in MHz)
SUBWF CNT1 ;SUBWF/ADDWF (-/+)
BTFSC STATUS,C
GOTO CONV01
MOVF CNT2,F
BTFSC STATUS,Z
GOTO CONVERR
DECF CNT2
CONV01 CLRF BUFF0
CLRF BUFF1
CLRF BUFF2
CLRF BUFF3
BTFSS CNT2,6 ;819.2
GOTO CONV02
MOVLW 8
MOVWF BUFF0
MOVLW 1
MOVWF BUFF1
MOVLW 9
MOVWF BUFF2
MOVLW 2
MOVWF BUFF3
CONV02 BTFSS CNT2,5 ;409.6
GOTO CONV03
MOVLW 4
ADDWF BUFF0
MOVLW 9
ADDWF BUFF2
MOVLW 6
ADDWF BUFF3
CONV03 BTFSS CNT2,4 ;204.8
GOTO CONV04
MOVLW 2
ADDWF BUFF0
MOVLW 4
ADDWF BUFF2
MOVLW 8
ADDWF BUFF3
CONV04 BTFSS CNT2,3 ;102.4
GOTO CONV05
MOVLW 1
ADDWF BUFF0
MOVLW 2
ADDWF BUFF2
MOVLW 4
ADDWF BUFF3
CONV05 BTFSS CNT2,2 ;51.2
GOTO CONV06
MOVLW 5
ADDWF BUFF1
MOVLW 1
ADDWF BUFF2
MOVLW 2
ADDWF BUFF3
CONV06 BTFSS CNT2,1 ;25.6
GOTO CONV07
MOVLW 2
ADDWF BUFF1
MOVLW 5
ADDWF BUFF2
MOVLW 6
ADDWF BUFF3
CONV07 BTFSS CNT2,0 ;12.8
GOTO CONV08
MOVLW 1
ADDWF BUFF1
MOVLW 2
ADDWF BUFF2
MOVLW 8
ADDWF BUFF3
CONV08 BTFSS CNT1,7 ;6.4
GOTO CONV09
MOVLW 6
ADDWF BUFF2
MOVLW 4
ADDWF BUFF3
CONV09 BTFSS CNT1,6 ;3.2
GOTO CONV10
MOVLW 3
ADDWF BUFF2
MOVLW 2
ADDWF BUFF3
CONV10 BTFSS CNT1,5 ;1.6
GOTO CONV11
MOVLW 1
ADDWF BUFF2
MOVLW 6
ADDWF BUFF3
CONV11 MOVLW 8
BTFSC CNT1,4 ;0.8
ADDWF BUFF3
MOVLW 4
BTFSC CNT1,3 ;0.4
ADDWF BUFF3
MOVLW 2
BTFSC CNT1,2 ;0.2
ADDWF BUFF3
MOVLW 1
BTFSC CNT1,1 ;0.1
ADDWF BUFF3
CONV20 MOVLW 0x0A
SUBWF BUFF3,W
BTFSS STATUS,C
GOTO CONV21
MOVWF BUFF3
INCF BUFF2
GOTO CONV20
CONV21 MOVLW 0x0A
SUBWF BUFF2,W
BTFSS STATUS,C
GOTO CONV22
MOVWF BUFF2
INCF BUFF1
GOTO CONV21
CONV22 MOVLW 0x0A
SUBWF BUFF1,W
BTFSS STATUS,C
GOTO CONV23
MOVWF BUFF1
INCF BUFF0
GOTO CONV22
CONV23 MOVF BUFF0,W
SUBLW 0x09
BTFSS STATUS,C
GOTO CONVERRMOVLW 0xFF
MOVWF DIGIT0
MOVWF DIGIT1
MOVF BUFF0,W
BTFSC STATUS,Z
GOTO CONV32
CALL CISLICE
MOVWF DIGIT0
MOVF BUFF1,W
CALL CISLICE
MOVWF DIGIT1
GOTO CONV33
CONV32 MOVF BUFF1,W
BTFSC STATUS,Z
GOTO CONV33
CALL CISLICE
MOVWF DIGIT1
CONV33 MOVF BUFF2,W
CALL CISLICE
MOVWF DIGIT2
MOVF BUFF3,W
CALL CISLICE
MOVWF DIGIT3
GOTO COUNT

CISLICE ADDWF PROGCNT
RETLW B’10000001′ ;0
RETLW B’10111011′ ;1
RETLW B’00100101′ ;2
RETLW B’00100011′ ;3
RETLW B’00011011′ ;4
RETLW B’01000011′ ;5
RETLW B’01000001′ ;6
RETLW B’10001011′ ;7
RETLW B’00000001′ ;8
RETLW B’00000011′ ;9

CONVERR MOVLW B’01000101′ ;Err_ indication
MOVWF DIGIT0
MOVLW B’01111101′
MOVWF DIGIT1
MOVWF DIGIT2
MOVLW 0xFF
MOVWF DIGIT3
GOTO COUNT

REFRESH BSF PORTA,3
MOVF DIGIT0,W
MOVWF PORTB
BCF PORTA,0
CALL TMRCHK
BSF PORTA,0
MOVF DIGIT1,W
MOVWF PORTB
BCF PORTA,1
CALL TMRCHK
BSF PORTA,1
MOVF DIGIT2,W
MOVWF PORTB
BCF PORTA,2
CALL TMRCHK
BSF PORTA,2
MOVF DIGIT3,W
MOVWF PORTB
BCF PORTA,3
CALL TMRCHK
NOP
NOP
NOP
RETURN

TMRCHK MOVLW 0x6F ;111x
MOVWF WORKA
CLRWDT
NOP
NOP
TMRCHK2 BTFSS INTC,2 ;1
GOTO TMRCHK3
BCF INTC,2
INCF CNTW
GOTO TMRCHK4
TMRCHK3 NOP
NOP
NOP ;6
TMRCHK4 NOP ;1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP ;10
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP ;20
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP ;30
NOP
NOP
NOP
NOP
NOP
NOP
CLRWDT
DECFSZ WORKA ;38
GOTO TMRCHK2
RETURN

END

Components List of Frequency Counter 0-1 GHz

  • R1 = 39Kohm; R2 = 1KOhm; R3-R6 = 2.2 kOhm; R7-R14 = 220Ohm
  • C1, C5, C6 = 100nF; C2, C3, C4 = 1NF; C7 = 100uF/25V; C8, C9 = 22pF
  • IC1 = 7805; IC2 = SAB6456; IC3 = PIC16F84A
  • T1 = BC546B; T2-T5 = BC556B
  • D1, D2 = BAT41; D3 = HD-M514RD (4 Digit 7 segment CA)
  • X1 = 4,000 MHz

Hopefully the article “Frequency Counter 0-1 GHz” useful and can provide inspiration to create your own frequency counter.

You may also like, related articles Frequency Counter 0-1 GHz