Datasheet
PICkit™ 3 Debug Express
DS41370C-page 22 © 2009 Microchip Technology Inc.
FIGURE 3-12: LESSON 2 “BLINK LED” CONFIGURATION BIT DEFINITIONS
The Configuration bits are defined using the #pragma config directive for each
Configuration Word. The MPLAB C attributes used to reference each bit or bit field
setting (i.e., “OSC = INTIO67”) may differ from one PIC18FXXXX microcontroller to
another, depending on the features supported by a particular microcontroller. All the
attributes available for a particular microcontroller may be found in the MPLAB IDE
help. Let’s find the attributes for the PIC18F45K20:
1. Select MPLAB IDE menu Help > Topics…
In the “MPLAB Help Topics” dialog, find the “Language Tools” category and select the
2. “PIC18 Config Settings” topic as shown in Figure . Click OK.
3. When the Help window opens, select the Contents tab, and expand the
“Configuration Settings” section.
4. Select the PIC18F45K20 microcontroller to display all the Configuration bit set-
ting attributes that can be used with the #pragma config directive, as shown
in Figure .
/** C O N F I G U R AT I O N B I T S ******************************/
#pragma config FOSC = INTIO67, FCMEN = OFF, IESO = OFF // CONFIG1H
#pragma config PWRT = OFF, BOREN = SBORDIS, BORV = 30 // CONFIG2L
#pragma config WDTEN = OFF, WDTPS = 32768 // CONFIG2H
#pragma config MCLRE = OFF,LPT1OSC = OFF, PBADEN = ON, CCP2MX = PORTC // CONFIG3H
#pragma config STVREN = ON, LVP = OFF, XINST = OFF // CONFIG4L
#pragma config CP0 = OFF, CP1 = OFF, CP2 = OFF, CP3 = OFF // CONFIG5L
#pragma config CPB = OFF, CPD = OFF // CONFIG5H
#pragma config WRT0 = OFF, WRT1 = OFF, WRT2 = OFF, WRT3 = OFF // CONFIG6L
#pragma config WRTB = OFF, WRTC = OFF, WRTD = OFF // CONFIG6H
#pragma config EBTR0 = OFF, EBTR1 = OFF, EBTR2 = OFF, EBTR3 = OFF // CONFIG7L
#pragma config EBTRB = OFF // CONFIG7H
FIGURE 3-13: MPLAB HELP TOPICS FIGURE 3-14: PIC18F45K20 CONFIGURATION