Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

What effect _config 0x3D18 has on the programmer?

Status
Not open for further replies.

lassy

Newbie level 4
Joined
Oct 6, 2004
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
53
question on PIC header

Does anyone know what effect _config 0x3D18 has on the programmer?
I downloaded a code with this header and when i change it,the code doesn not work on the Microcontroller.what exactly does it mean?
 

Re: question on PIC header

It means that the memory address 2007h (for the most of 16F PIC models) will be loaded with the value 3D18h (11 1101 0001 1000 bin) . These address contains the configuration fuses that will set the mode the PIC will work. As examples you set the type of oscillator (internal, external, xtal, high speed, etc), if the MCLR is internal or external, if the watchdog is disebled or not, etc.

Doing this way, you put a value directly in the fuse address. You can write the same line with "words" as following:

__CONFIG _WDT_ON & _XT_OSC & _PWRTE_ON & _LVP_OFF

obs. this line does not mean exactly 3D18h (i am writing just an example)

Each one of the terms above sets or resets a bit in the fuse address, resulting in the same value as if you write a hexadecimal value.

Look in the files inside the MPLAB directory, specially those with .INC extension and you find these lines (for the 16F819.INC):

_CP_ALL EQU H'1FFF'
_CP_OFF EQU H'3FFF'
_CCP1_RB2 EQU H'3FFF'
_CCP1_RB3 EQU H'2FFF'
_DEBUG_OFF EQU H'3FFF'
_DEBUG_ON EQU H'37FF'
_WRT_ENABLE_OFF EQU H'3FFF'
_WRT_ENABLE_512 EQU H'3DFF'
_WRT_ENABLE_1024 EQU H'3BFF'
_WRT_ENABLE_1536 EQU H'39FF'
_CPD_ON EQU H'3EFF'
_CPD_OFF EQU H'3FFF'
_LVP_ON EQU H'3FFF'
_LVP_OFF EQU H'3F7F'
_BODEN_ON EQU H'3FFF'
_BODEN_OFF EQU H'3FBF'
_MCLR_ON EQU H'3FFF'
_MCLR_OFF EQU H'3FDF'
_PWRTE_OFF EQU H'3FFF'
_PWRTE_ON EQU H'3FF7'
_WDT_ON EQU H'3FFF'
_WDT_OFF EQU H'3FFB'
_EXTRC_CLKOUT EQU H'3FFF'
_EXTRC_IO EQU H'3FFE'
_INTRC_CLKOUT EQU H'3FFD'
_INTRC_IO EQU H'3FFC'
_EXTCLK EQU H'3FEF'
_HS_OSC EQU H'3FEE'
_XT_OSC EQU H'3FED'
_LP_OSC EQU H'3FEC'
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top