Configuration Bits - are a collection of special bits that can only be modified at program time. Configuration bits are "read" during reset and enable or disable hardware features in the microcontroller. The features controlled by the configuration bits include, but not limited to, the clock source, WatchDog timer, brownout detect and Memory Read protection. Configuration bits are not executable code they are essentially fuses located in the program memory space.
How Configuration Bits are set
Each PIC® MCU has it's own set of configuration bits. The Special Features section of the individual datasheets contains the definition for each of the bits.
The setting for each configuration bit is determined by directives written in the application software. The syntax for the configuration bit settings is available from the compiler manual. This tutorial will show how to generate proper configuration code without consulting the compiler manual for the proper syntax.
How to display the Configuration Bits window
From the main menu select Window ▶ PIC Memory Views ▶ Configuration Bits
Click image to enlarge
The Configuration Bits window will open in a tab in the Output area under the editor.
How to set configuration bits and generate initialization code
3
The IDE will automatically generate the code necessary to initialize all the configuration bits to the settings you specified in the window. This code may now be copied and pasted into one of your source files, or you may save it to its own file and add it to your project. To save the file, right click anywhere in the output window and select Save As from the popup menu as shown in the screenshot at left.