configuration bits of PIC MCUs for HI-Tech C

Thread Starter

sairfan1

Joined May 24, 2012
107
Hi,
im going to use 16F84A for the first time, after reading its datasheet i came to know, it has four configuration bits
FOSC0, FOSC1, WDTE, PWRTE, CP
based on this im unable to understand what could be name of parameters for _CONFIG(??,??,??); i want to know when we use some mcu for the first time how can we understand names to specify as paramters.

thanks.
 

absf

Joined Dec 29, 2010
1,968
FOSC0, FOSC1, WDTE, PWRTE, CP
based on this im unable to understand what could be name of parameters for _CONFIG(??,??,??); i want to know when we use some mcu for the first time how can we understand names to specify as paramters.
All you'll need is here

Rich (BB code):
; The following is an assignment of address values for all of the
; configuration registers for the purpose of table reads
_CONFIG          EQU  H'2007'

;----- CONFIG Options --------------------------------------------------
_FOSC_LP             EQU  H'3FFC'    ; LP oscillator
_LP_OSC              EQU  H'3FFC'    ; LP oscillator
_FOSC_XT             EQU  H'3FFD'    ; XT oscillator
_XT_OSC              EQU  H'3FFD'    ; XT oscillator
_FOSC_HS             EQU  H'3FFE'    ; HS oscillator
_HS_OSC              EQU  H'3FFE'    ; HS oscillator
_FOSC_EXTRC          EQU  H'3FFF'    ; RC oscillator
_RC_OSC              EQU  H'3FFF'    ; RC oscillator

_WDTE_OFF            EQU  H'3FFB'    ; WDT disabled
_WDT_OFF             EQU  H'3FFB'    ; WDT disabled
_WDTE_ON             EQU  H'3FFF'    ; WDT enabled
_WDT_ON              EQU  H'3FFF'    ; WDT enabled

_PWRTE_ON            EQU  H'3FF7'    ; Power-up Timer is enabled
_PWRTE_OFF           EQU  H'3FFF'    ; Power-up Timer is disabled

_CP_ON               EQU  H'000F'    ; All program memory is code protected
_CP_OFF              EQU  H'3FFF'    ; Code protection disabled

Allen
 

t06afre

Joined May 11, 2009
5,934
it is actually __config (two underscores) In the folder ....instal dir\HI-TECH Software\PICC\9.83\include you will find the header file for your chip. Almost at the top of your header file. You will find the options gor your chip. Then you and the different selected options together like this as an example
Rich (BB code):
__config _FOSC_XT & _WDTE_OFF & _PWRTE_OFF & _CP_OFF
 
Top