音影先锋亚洲天堂网|电影世界尽头的爱完整版播放|国产 熟女 91|高清无码免费观看欧美日韩|韩国一区二区三区黄色录像|美女亚洲加勒比在线|亚洲综合网 开心五月|7x成人在线入口|成人网站免费日韩毛片区|国产黄片?一级?二级?三级

登錄 免費(fèi)注冊(cè) 首頁(yè) | 行業(yè)黑名單 | 幫助
維庫(kù)電子市場(chǎng)網(wǎng)
技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測(cè)控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng)
驅(qū)動(dòng)編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe

16f628a難道不能用內(nèi)置晶振么

作者:newer_zhk 欄目:單片機(jī)
16F628A難道不能用內(nèi)置晶振么
燒寫時(shí)出現(xiàn)如下錯(cuò)誤
ICDWarn0033: MPLAB ICD 2 does not SUPPORT PROGRAMMING this DEVICE if both the internal oscillator and internal MCLR are selected.  You may continue PROGRAMMING, but you are encouraged to cancel, reconfigure your DEVICE, and try again.

When Internal MCLR is used with MPLAB ICD 2 for PROGRAMMING, both Vpp and Vdd are powered together, and then Vpp is pulled high to Vihh to enter PROGRAMMING mode. This means that your code will be running before Vpp goes to Vihh. If that code makes use of port pins that correspond to Clock and Data pins in PROGRAMMING mode, there is a chance their values may not be 0, as necessary to enter PROGRAMMING mode. Therefore, the DEVICE could not be reprogrammed.



程序如下

是不是初始化端口配置有問(wèn)題啊



    list      p=16F628A           ; list directive to define processor
    #include <p16F628A.inc>       ; processor specific variable definitions

    errorlevel  -302              ; suppress message 302 from list file

;    __CONFIG   _CP_OFF & _DATA_CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTOSC_OSC_NOCLKOUT

; '__CONFIG' directive is used to embed configuration word within .asm file.
; The lables following the directive are located in the respective .inc file.
; See data sheet for additional information on configuration word settings.




;***** VARIABLE DEFINITIONS
w_temp        EQU     0x71        ; variable used for context saving
status_temp   EQU     0x72        ; variable used for context saving

;定義主程序用寄存器
count       EQU     0x74          ; 定義計(jì)數(shù)寄存器地址
tmp1        EQU     0x75          ; 定義臨時(shí)寄存器地址    
x           EQU     0x76          ; 延時(shí)子程序外循環(huán)計(jì)數(shù)器
y           EQU     0x77          ; 延時(shí)子程序內(nèi)循環(huán)計(jì)數(shù)器        

tmp2        EQU     0x78
count1      EQU     0x79


SCK           EQU     2           ;RB2
SDI           EQU     3           ;RB3
SWITCH        EQU     4           ;RB4



;**********************************************************************
    ORG     0x000             ; processor reset vector
    nop
    goto    main              ; go to beginning of program
    

    ORG     0x004             ; interrupt vector location
    

    movwf   w_temp            ; save off current W register contents
    movf    STATUS,w          ; move status register into W register
    movwf    status_temp       ; save off contents of STATUS register

; isr code can go here or be located as a call subroutine elsewhere


    movf    status_temp,w     ; retrieve copy of STATUS register
    movwf    STATUS            ; restore pre-isr STATUS register contents
    swapf   w_temp,f
    swapf   w_temp,w          ; restore pre-isr W register contents
    retfie                    ; return from interrupt
    
;******************************************************

main

;******************************************************

init
    CLRF    INTCON
    
    CLRF    PORTA             ;Initialize PORTA and PORTB by
    CLRF    PORTB          ;setting OUTPUT data latches

    MOVLW   0x07           ;Turn comparators off and
    MOVWF   CMCON           ;enable pins for I/O
                  ;functions
    BCF     STATUS, RP1
    BSF     STATUS, RP0       ;SELECT Bank1
    
    CLRF    PCON
    BSF     PCON,OSCF
    
    MOVLW   0x1F           ;VALUE used to initialize
                  ;data direction
    MOVWF   TRISA           ;Set RA<4:0> as inputs
                  ;TRISA<5> always read as ‘1’.
                  ;TRISA<7:6> depend on oscillator mode
                  
    CLRF    TRISB

    
    BCF    
2樓: >>參與討論
xieyuanbin
上面的提示已經(jīng)告訴你很明白了。
 
3樓: >>參與討論
lhjlxr
回復(fù):16F628A難道不能用內(nèi)置晶振么
直接燒程序,即可提示不用管.cpu工作會(huì)正常的.


4樓: >>參與討論
newer_zhk
關(guān)鍵是最后一句啊
是不是真的不能再次編程了啊

參與討論
昵稱:
討論內(nèi)容:
 
 
相關(guān)帖子
請(qǐng)問(wèn),SmartDraw 7.01如何注冊(cè)?
問(wèn)一個(gè)關(guān)于RB中斷的問(wèn)題
請(qǐng)教斑主與各位工程師
18f系列 daw的用法
12C508問(wèn)題(最簡(jiǎn)單的程序,怎么也不能運(yùn)行)
免費(fèi)注冊(cè)為維庫(kù)電子開發(fā)網(wǎng)會(huì)員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入


Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號(hào)