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


Browsing this Thread:   1 Anonymous Users






Re: PIC24H 的 configuration bit 如何設定?
#3
新會員
新會員


查看用戶資訊
感謝版主大人!

發表於: 2008/11/10 20:22
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC24H 的 configuration bit 如何設定?
#2
版主
版主


查看用戶資訊
以下為設定範例:
// External Oscillator
_FOSCSEL(FNOSC_PRIPLL IESO_OFF);                    // Primary (XT, HS, EC) Oscillator with PLL
_FOSC(FCKSM_CSDCMD OSCIOFNC_OFF  POSCMD_XT);    // Clock Switching and Fail Safe Clock Monitor is disabled
                                                    // OSC2 Pin Function: OSC2 is Clock Output

_FWDT(FWDTEN_OFF);                                     // Watchdog Timer Enabled/disabled by user software
                                                    // (LPRC can be disabled by clearing SWDTEN bit in RCON register
_FPOR(PWMPIN_OFF HPOL_ON LPOL_OFF FPWRT_PWR1);                                   // Turn off the power-up timers.
_FGS(GCP_OFF);                                        // Disable Code Protection


如需更詳細的定義說明,請參考該元件的 H 檔之說明:
C:\Program Files\Microchip\MPLAB C30\support\PIC24H\h

:
:
/* Register FOSCSEL (0xf80006) */

#define _FOSCSEL(x) __attribute__((section("__FOSCSEL.sec,code"))) int _FOSCSEL = (x);

/*
** Only one invocation of FOSCSEL should appear in a project,
** at the top of a C source file (outside of any function).
**
** The following constants can be used to set FOSCSEL.
** Multiple options may be combined, as shown:
**
** _FOSCSEL( OPT1_ON & OPT2_OFF & OPT3_PLL )
**
** Oscillator Source Selection:
** FNOSC_FRC Fast RC oscillator
** FNOSC_FRCPLL Fast RC oscillator w/ divide and PLL
** FNOSC_PRI Primary oscillator (XT, HS, EC)
** FNOSC_PRIPLL Primary oscillator (XT, HS, EC) w/ PLL
** FNOSC_SOSC Secondary oscillator
** FNOSC_LPRC Low power RC oscillator
** FNOSC_FRCDIV16 Fast RC oscillator w/ divide by 16
** FNOSC_LPRCDIVN Low power Fast RC oscillator w/divide by N
**
** Two-speed Oscillator Startup :
** IESO_OFF Disabled
** IESO_ON Enabled
**
*/

#define FNOSC_FRC 0xFFF8
#define FNOSC_FRCPLL 0xFFF9
#define FNOSC_PRI 0xFFFA
#define FNOSC_PRIPLL 0xFFFB
#define FNOSC_SOSC 0xFFFC
#define FNOSC_LPRC 0xFFFD
#define FNOSC_FRCDIV16 0xFFFE
#define FNOSC_LPRCDIVN 0xFFFF

#define IESO_OFF 0xFF7F
#define IESO_ON 0xFFFF
:
:

發表於: 2008/11/10 15:05
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


PIC24H 的 configuration bit 如何設定?
#1
新會員
新會員


查看用戶資訊
大家好!

我想在 c code 中 設定 PIC24H 的 configuration bit
但找不到其語法的說明資料,不知有誰知道?

發表於: 2008/11/10 12:04
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... ]

教育訓練中心

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