Academic Program

Configuration Bits

Configuration Bits

Configuration Bits are a collection of binary data located in the flash memory of a PIC Microcontroller (MCU). Configuration bits are programmed into the PIC MCU with the application code. They are not executable code as their address is not accessible by the program counter. When programmed into a PIC MCU, configuration bits complete circuitry which enables or disables hardware features of the MCU.

Configuration bits are read when exiting a reset and cannot be modified during run-time.

The special features of MCU operation controlled by the configuration bits include:

  1. System Clocking
  2. Power Management
  3. Device Security
  4. Operating Characteristics

Configuration bits are generated from compiler/assembler directives included in the source code files.
This page describes what features are controlled by configuration bits and how to generate them in the source code.

The configuration bits and settings for individual PIC16F1xxx devices may vary. Check your datasheet for the specifics of the PIC MCU configuration bits you are using.

 

Location and Format

The configuration bits for the PIC16F1 MCU family are combined into two 14-bit words called CONFIG1 and CONFIG2. The configuration words are located beyond the reach of the program counter at addresses 0x8007 and 0x8008 in the MCU's flash memory.

Configuration Settings from PIC16F1937 Data Sheet

config1.png

config2.png

Configuration bits are inserted into the application's source code. When a PIC MCU project is built, the configuration bit settings are loaded into the HEX output file. The configuration bits are programmed into the PIC with the application program.