The #pragma config
directive specifies the
device-specific configuration settings (i.e., Configuration bits) to be used by the
application:
# pragma config setting-list
where
setting-list: |
A list of one or
more setting-name = value-name macro pairs, separated by
commas. |
Macros are specified in the device header file (*.h
) that
is located in the Windows OS default directory:
C:\Program Files\Microchip\MPLAB C32\pic32mx\include\proc
Pragma case does not matter; either #PRAGMA CONFIG
or #pragma config
is acceptable. Macro case should match what is in the
header.
In the “MPLAB® C Compiler for PIC32 MCUs User’s Guide” (DS50001686), see “Configuration Bit Access.”
Example
#include “p32xxxx.h”
//Enables the Watchdog Timer,
// Sets the Watchdog Postscaler to 1:128
#pragma config FWDTEN = ON, WDTPS = PS128
//Selects the HS Oscillator for the Primary Oscillator
#pragma config POSCMOD = HS