• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users






Re: C30 的 COMPILER PIC24 之 CONFIG 關鍵字
#3
版主
版主


查看用戶資訊
dsPIC24HJ 的 configurations 設定噢不ㄧ樣,請參考dsPIC24HjJ 的 H 檔的定義。
底下為一個使用的設定範例:

// Internal FRC Oscillator
_FOSCSEL(FNOSC_FRCPLL ); // FRC Oscillator with PLL
_FOSC(FCKSM_CSDCMD & OSCIOFNC_OFF & POSCMD_NONE);
// Clock Switching and Fail Safe Clock Monitor is disabled
// OSC2 Pin Function: OSC2 is Clock Output
// Primary Oscillator Mode: Disabled


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

void Clear_DMA_Buffer(void);
extern int _DMA_BASE;

int main(void)

{

// Configure Oscillator to operate the device at 73.7Mhz

// Fosc= Fin*M/(N1*N2), Fcy=Fosc/2
// Fosc= 7.37M*40(2*2)=73.7Mhz for 7.37MHz input clock
PLLFBD=38; // M=40, PLLFBD= M - 2 = 38
CLKDIVbits.PLLPOST=0; // N1=2
CLKDIVbits.PLLPRE=0; // N2=2
OSCTUN=0;

發表於: 2007/11/14 16:45
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: C30 的 COMPILER PIC24 之 CONFIG 關鍵字
#2
版主
版主


查看用戶資訊
可以直接參考元件的 h 檔的說明,那裡有該元件的定義:
C:\Program Files\Microchip\MPLAB C30\support\h\pic24fj128ga110.h

/* -------------------------------------------------------- */
/* Macros for setting device configuration registers        */
/* -------------------------------------------------------- */

/* Register CONFIG3 (0x157fa)                               */

#define _CONFIG3(x) __attribute__((section("__CONFIG3.sec,code"))) int _CONFIG3 = (x);

/*
** Only one invocation of CONFIG3 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 CONFIG3.
** Multiple options may be combined, as shown:
**
** _CONFIG3( OPT1_ON & OPT2_OFF & OPT3_PLL )
**
**   Write Protection Location:
**     WPEND_WPSTARTMEM     Write Protect from page 0 to WPFP
**     WPEND_WPENDMEM       Write Protect from WPFP to the last page of memory
**
**   Write Protect Configuration Page:
**     WPCFG_WPCFGEN        Enabled
**     WPCFG_WPCFGDIS       Disabled

發表於: 2007/11/14 16:35
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


C30 的 COMPILER PIC24 之 CONFIG 關鍵字
#1
新會員
新會員


查看用戶資訊
請問各位大大:

有誰知道 用C30 COMPILER PIC24的 CONFIG BIT 的設定關鍵字是有哪些? 有PDF檔案嗎?(PIC18的我有但不了解PIC24是不是也有.....)

謝謝

發表於: 2007/11/13 22:14
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... ]

教育訓練中心

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