中文字幕无码不卡一区二区三区_少妇被又大又粗又爽毛片久久黑人_91精品国产在热久久无毒不卡_久久久久久亚洲综合网站

技術(shù)熱線: 4007-888-234
設(shè)計開發(fā)

專注差異化嵌入式產(chǎn)品解決方案 給智能產(chǎn)品定制注入靈魂給予生命

開發(fā)工具

提供開發(fā)工具、應(yīng)用測試 完善的開發(fā)代碼案例庫分享

技術(shù)支持

從全面的產(chǎn)品導(dǎo)入到強大技術(shù)支援服務(wù) 全程貼心伴隨服務(wù),創(chuàng)造無限潛能!

新品推廣

提供新的芯片及解決方案,提升客戶產(chǎn)品競爭力

新聞中心

提供最新的單片機資訊,行業(yè)消息以及公司新聞動態(tài)

一款用F84做的測頻儀

更新時間: 2019-03-23
閱讀量:1778

十年專注單片機方案開發(fā)的方案公司英銳恩,分享一款用F84做的測頻儀。英銳恩現(xiàn)提供服務(wù)產(chǎn)品涉及主控芯片:8位單片機、16位單片機、32位單片機及各類運算放大器等。

;*******************************************************************
;
;        Frequency display
;        Crystal freq. 4.000MHz +/- a bit
;
;*******************************************************************
;
;        FM000.TXT Originally from FM3/4 9:39pm 14 May 2002
;        As implemented in experimental 3.5MHz receiver
;
;*******************************************************************
;
;        FM003        Fixed? major silliness in LO-IF code
;                Re-wrote USB/LSB suffix code
;                Added #defines for crook displays
;                Added #defines for two line displays
;                Wrapped #ifdef ... endif around debugging code
;
;*******************************************************************

;#define        testing                1        ; Comment out when testing finished

;#define        Bad_Display        1        ; Un-comment for "stop at 8" displays

;#define        Two_Line        1        ; Un-comment for two line displays

;*******************************************************************
;
;        CPU configuration
;        It's a 16F84, HS oscillator,
;        watchdog timer off, power-up timer on
;

        processor        16f84
        include               
        __config        _HS_OSC & _PWRTE_ON & _WDT_OFF


#define S_out        PORTA,0x00        ; 9600 baud serial out

#define        PUFF        PORTA,0x00        ; Future stabiliser
#define        HUFF        PORTA,0x01        ; Ditto.
#define        ENA        PORTA,0x02        ; Display "E"
#define        RS        PORTA,0x03        ; Display "RS"
#define PORTA4        PORTA,0x04        ; From LS393 divider chip

#define RESET        PORTB,0x01        ; Pin  7, Counter RESET
#define        UP_CNT        PORTB,0x02        ; Pin  8, Counter FLUSH
#define GATE        PORTB,0x03        ; Pin  9, Counter GATE
#define        Store        PORTB,0x04        ; Pin 10, 0 = Measure BFO
#define        Add_LO        PORTB,0x05        ; Pin 11, 0 = RF := LO + IF
                                ;         1 = RF := | LO + (-IF) |
#define        BFO_Lo        PORTB,0x06        ; Pin 12, 0 = BFO on lower freq.
#define        BFO_Hi        PORTB,0x07        ; Pin 13, 0 = BFO on higher freq.

#define        LOK_FLG        FLAGS,0x06
#define        Prg_FLG        FLAGS,0x05
#define        Ovr_Rng        FLAGS,0x04
#define        AMflag        FLAGS,0x03        ; 0 = Don't print USB/LSB suffix

#define BANKSEL        STATUS,RP0

#define        beq        bz                ; Motorola syntax branches
#define        BEQ        bz
#define        BNE        bnz
#define        bne        bnz

#define        BCC        bnc
#define        bcc        bnc
#define        BCS        bc
#define        bcs        bc

#define        BRA        goto
#define        bra        goto

;*******************************************************************
;
;        file register declarations: use only registers in bank0
;        bank 0 file registers begin at 0x0c in the 16F84
;
;*******************************************************************

        cblock 0x0c

        COUNT                        ; Bin to BCD convert (bit count)
        TEMP
        cnt                        ;                    (BCD BYTES)

        COUNT1                        ; Used by delay routines
                                ; and "prescaler flush"
        COUNT2                        ; Timing (100ms)

 COUNT3                        ; Timing (100ms)
        COUNT4                        ; Timing (400ms)


        CHR

        AccA:3                        ; Binary, MSB first
       
        AccB:3                        ; Intermediate frequency
       
        bcd:4                        ; BCD, MSD first 

 FLAGS

        SBflag                        ; 0 = Lower BFO frequency
                                ; 1 = Higher

        W_TEMP                        ; W saved here by ISR
        STATUS_TEMP                ; Status Register saved here by ISR
       
        dbg0:3                        ; Debugging stuff
        dbg1:3
        dbg2:3
        dbg3:3
        dbg4:3
        dbg5:3

        S_Wtemp                        ; "debug" Variables
        S_count
        D_Wtemp
        D_Stemp
        D_FSR
        D_hex
       
        endc

;**********************************************************
;
;        Begin Executable Stuff(tm)
;

        org        0

GO        clrwdt                        ; 0 << Reset
        call        InitIO                ; 1    INITIALISE PORTS

  CLRF        PORTA                ; 2
        goto        START                ; 3

INTRUPT        goto        ISR                ; 4 << Interrupt

;**********************************************************
;
;        Text Strings (stored in RETLWs)
;

mhz        dt        " MHz ",0
Spaces        dt        "   ",0
USB        dt        "USB",0
LSB        dt        "LSB",0
Prog        dt        "PRG",0

adv1        dt        "DFM 3.0 ",0
adv2        dt        "- VK3BHR",0

ovr1        dt        "   Over ",0
ovr2        dt        "Range   ",0

#ifdef        Two_Line

adv3        dt        "1234567890ABCDEF",0

endif


;**********************************************************
;
;        Main Program
;

START        CLRF        PORTB

#ifdef        testing
        bsf        PUFF
endif

        CALL        LCDINIT                 ; INITIALIZE LCD MODULE       

        MOVLW        adv1                ; Sign on
        call        pmsg

#ifdef        Bad_Display
        CALL        LINE2
endif

        movlw        adv2
        call        pmsg
       
        MOVLW        0x28                ; Delay for 4 sec.       
        CALL        DECI
        CALL        CLEAR

tx_1        decfsz        S_count,f        ; Done all bits?
        goto        put_clp

        movlw        0xE7                ; Delay for last data
txd_1        addlw        0x01
        bne        txd_1

        bsf        S_out                ; Transmit two stop bit

        movlw        0xCD
txd_9        addlw        0x01
        bne        txd_9
       
        return

endif

;********************************************************************
;        Tail End Charlie
;********************************************************************       
        END

清水河县| 宁乡县| 苍南县| 静宁县| 高尔夫| 藁城市| 新平| 顺昌县| 裕民县| 义乌市| 罗甸县| 商都县| 阳高县| 梁平县| 拉孜县| 北宁市| 湄潭县| 定陶县| 康保县| 栖霞市| 黄陵县| 昌吉市| 东方市| 越西县| 慈溪市| 高邑县| 周宁县| 高雄市| 兴城市| 五寨县| 涞源县| 巴塘县| 玛纳斯县| 古浪县| 革吉县| 仁化县| 屏南县| 苏州市| 达拉特旗| 司法| 兴城市|