• slider image 514
  • slider image 516
  • slider image 517
  • slider image 518
  • slider image 519
:::


Browsing this Thread:   1 Anonymous Users






Re: 請問PIC18F4620的內部晶振要怎麼設定
#2
版主
版主


查看用戶資訊
Copy 102ASP 的教材裡的 config 的設定。使用內部 RC 設為 1MHz 的 Fosc.

LIST     P=18F4520    ;directive to define processor 
        
#include <P18F4520.INC>    ;processor specific variable definitions

CONFIG  OSC INTIO7        Internal oscillator blockCLKO 
                    
; function on RA6,port function on RA7
CONFIG    FCMEN 
OFF,IESO OFF
CONFIG    PWRT 
ONBOREN OFFWDT OFF,MCLRE ON
CONFIG    PBADEN 
OFF         PORTB<4:0pins are configured as
                    ; 
digital I/O on Reset
CONFIG    CCP2MX 
PORTC     CCP2 input/output is multiplexed with 
                    
RC1
CONFIG    STVREN 
OFFLVP OFF
CONFIG    CPB 
OFFCP0 OFFCP1=OFFCP2 OFF,CP3 OFF


有關使用 C18 的 Config 設定請參考 c:\mcc18\doc\hlpPIC18ConfigSet.heml 裡的說明,底下是其設定的語法:
;*******************************************************************************
;*
3.For MPLAB C18 V2.40 or higher, use #pragma config directive                       *
;*for example                                                                     *    
//******************************************************************************
    #include <p18f452.h>
//*******************************************************************************
//*Configuration settings may be specified with multiple #pragma config directives.          *
//*MPLAB C18 verifies that the configuration settings specified are valid for the processor*
//*for which it is compiling                                                                                *            
//*The labels following the directive "pragma config" are defined in the P18F452.h file.    *
//*******************************************************************************
    #pragma config    OSC=HS
    #pragma config     PWRT=ON
    #pragma config     BOR=OFF, BORV=42
    #pragma config     WDT=OFF
    #pragma config      CCP2MUX=ON
    #pragma config      STVR=OFF, LVP=OFF, DEBUG=OFF
    #pragma config      CPD=OFF
    
void main(void)
{
//your code
}
//********************************************************************************

Attach file:



jpg  (0.00 KB)


發表於: 2009/4/9 8:06
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


請問PIC18F4620的內部晶振要怎麼設定
#1
中級會員
中級會員


查看用戶資訊
請問一下喔

我打算用4620而不是用石英振盪器

所以要用內部振盪電路

而幫我把設
Config1H = 0b00001001

的確成功晶振了, 這時我用示波器量OSC接腳為250Hz

我想試著把這個頻率調成可以讓我所掌控

但是之後改變其他的暫存器

似乎都沒辦法改變這個頻率

不知道這要怎麼處理@@

發表於: 2009/4/8 20:25
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------