How Do I Find The Names Used To Represent SFRs And Bits?

Special function registers, as well as the bits within them, are accessed via special variables that map over the register; however, the names of these variables sometimes differ from those indicated in the data sheet for the device you are using.

If required, you can examine the <xc.h> header file to find the device-specific header file that is relevant for your device. This file will define the variables that allow access to these special variables. However, an easier way to find these variable names is to look in any of the preprocessed files left behind from a previous compilation. Provided the corresponding source file included <xc.h>, the preprocessed file will show the definitions for all the SFR variables and bits for your target device.

If you are compiling under MPLAB X IDE for a configuration called default, the preprocessed file(s) are left under thebuild/default/production directory of your project for regular builds, or under build/default/debug for debug builds. They are typically left in the source file directory if you are compiling on the command line. These files have an .i extension.