A macro specified in the htc.h header file is used to set device
Configuration Words for PIC10/12/16 MCUs:
__CONFIG(x);
where
x |
Expression representing the value to which the specified Configuration bits will be set. May be literal but usually represented by a macro or macros ANDed together. |
Macros are specified in the device header file (*.h
) that
is located in the Windows OS default directory:
C:\Program Files\HI-TECH Software\PICC\vx.xx\include
where vx.xx
is the version number of the compiler.
For devices that have more than one Configuration Word location, each
subsequent invocation of __CONFIG()
will modify the next Configuration
Word in sequence.
Macro case should match what is in the relevant header. For
htc.c
, __CONFIG()
is correct but
__config()
is not.
In “HI-TECH C for PIC10/12/16 User’s Guide” (DS51865), see “Configuration Fuses.”
PICC Example
#include <htc.h>
__CONFIG(WDTDIS & XT & UNPROTECT); // Program config. word 1
__CONFIG(FCMEN); // Program config. word 2