_ _CONFIG - Set Processor Configuration Bits

MPASM Assembler

_ _CONFIG - Set Processor Configuration Bits

Note: config is preceded by two underline characters, with no space in between these characters. A space is added here for readability only.

Syntax

_ _config <expr> OR _ _config <addr>, <expr>

Description

Sets the processor's configuration bits to the value described by <expr>. For PIC18CXXX devices, the address of a valid configuration byte must also be specified by <addr>. Refer to individual PICmicro microcontroller data sheets for a description of the configuration bits.

Before this directive is used, the processor must be declared through the command line, the list directive, or the processor directive. If this directive is used with the PIC17CXXX family, the Hex file output format must be set to INHX32 through the command line or the list directive.

Examples

example 1:

list p=17c42,f=INHX32 ;define processor and select output format

_ _config H'FFFF' ;default configuration bits

example 2:

list p=16f877a ;list directive to define processor

#include <p16f877a.inc> ;include file with config bit definitions

_ _config _HS_OSC & _WDT_OFF & _LVP_OFF ;Set oscillator to HS,

;watchdog time off,

;low-voltage prog. off

example 3:

list p=18f8720 ;list directive to define processor

#include <p18f8720.inc> ;include file with config bit definitions

__CONFIG _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H ;Set osc info

__CONFIG _CONFIG2L, _BOR_OFF_2L & _PWRT_OFF_2L ;Set power info

See Also

_ _IDLOCS LIST PROCESSOR


Microchip Technology Inc.
Microchip's Web Site
Voice: (480) 792-7200
Fax: (480) 899-9210
Microchip's E-mail Address
PreviousNext