C18 Toolchain

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 default directory:

C:\program files\microchip\mplabc18\vx.xx\.h

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 C18 C Compiler User’s Guide” (DS50001288), see “Pragms,” “#pragma config.”

Example

#include <p18cxxx.h>
/*Oscillator switch enabled, RC oscillator with OSC2 as I/O pin.*/
#pragma config OSCS = ON, OSC = LP
/*Watch Dog Timer enable, Watch Dog Timer PostScaler count - 1:128*/
#pragma config WDT = ON, WDTPS = 128