configuration bits of PIC MCUs for HI-Tech C

Discussion in 'Embedded Systems and Microcontrollers' started by sairfan1, Jul 3, 2012.

  1. sairfan1

    Thread Starter Member

    May 24, 2012
    46
    1
    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.
     
  2. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    search for the MPLAB menu to view configuration bits.
    And use the names displayed there.
     
  3. absf

    Senior Member

    Dec 29, 2010
    1,493
    372
    All you'll need is here

    Code ( (Unknown Language)):
    1. ; The following is an assignment of address values for all of the
    2. ; configuration registers for the purpose of table reads
    3. _CONFIG          EQU  H'2007'
    4.  
    5. ;----- CONFIG Options --------------------------------------------------
    6. _FOSC_LP             EQU  H'3FFC'    ; LP oscillator
    7. _LP_OSC              EQU  H'3FFC'    ; LP oscillator
    8. _FOSC_XT             EQU  H'3FFD'    ; XT oscillator
    9. _XT_OSC              EQU  H'3FFD'    ; XT oscillator
    10. _FOSC_HS             EQU  H'3FFE'    ; HS oscillator
    11. _HS_OSC              EQU  H'3FFE'    ; HS oscillator
    12. _FOSC_EXTRC          EQU  H'3FFF'    ; RC oscillator
    13. _RC_OSC              EQU  H'3FFF'    ; RC oscillator
    14.  
    15. _WDTE_OFF            EQU  H'3FFB'    ; WDT disabled
    16. _WDT_OFF             EQU  H'3FFB'    ; WDT disabled
    17. _WDTE_ON             EQU  H'3FFF'    ; WDT enabled
    18. _WDT_ON              EQU  H'3FFF'    ; WDT enabled
    19.  
    20. _PWRTE_ON            EQU  H'3FF7'    ; Power-up Timer is enabled
    21. _PWRTE_OFF           EQU  H'3FFF'    ; Power-up Timer is disabled
    22.  
    23. _CP_ON               EQU  H'000F'    ; All program memory is code protected
    24. _CP_OFF              EQU  H'3FFF'    ; Code protection disabled
    25.  

    Allen
     
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    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
    Code ( (Unknown Language)):
    1. __config _FOSC_XT & _WDTE_OFF & _PWRTE_OFF & _CP_OFF
     
Loading...