Microchip 的XC16 Compiler中可以使用 #pragma config,

在XC16的使用指南 40頁 有說明語法如下

#pragma config  setting = state| value

setting 是一個設置描述符(如WDT), state 是一個描述值(如ON),  Value是一個數值。

 

請注意,使用的器件是否支援此指令需要查閱如下

查閱路徑 打開MPLAB X IDE => 點擊問號(compiler help) 

image

 

 

此時會跳開如下視窗

在視窗中找尋 Configuration Settings Reference,並點入

 

 

image

 

在搜尋你使用的器件

 

image

 

此時你的器件支持的 #pragma config, 會顯示如下

 

image

 

此時只需再跳入主程式之前 設置好你的#pragma config,就可以了。

 

arrow
arrow

    小影 發表在 痞客邦 留言(0) 人氣()