# configuration bits and their importance

#### ect_09

Joined May 6, 2012
180
Hello everybody,
as you know am new with PIC18f452. i become successful to run LED Blinking code on hardware.although its was copy paste first time but i understand all the code and configuration bits but am confused in

__CONFIG(1, OSCSDIS & HSPLL);

__CONFIG(2, BORDIS & PWRTDIS & WDTDIS);

what is this meaning that these are being AND with one another .??
can i write all the configuration bit in a single line with the bits that AND with one another.

Regards,

#### ericgibbs

Joined Jan 29, 2010
9,386
hi ect,
Look at this PDF list of CONFIG options, select 18F452.
E

#### Attachments

• 2.4 MB Views: 43

#### ect_09

Joined May 6, 2012
180
hi ect,
Look at this PDF list of CONFIG options, select 18F452.
E
my question was something different

#### Art

Joined Sep 10, 2007
806
I don't think they are logically and in that context.
They might be in two lines because the bits are parts of two config bytes/words.

Are you using a BASIC or C compiler?
The midrange pic config in asm might look something like:
Code:
DEVICE LVP_OFF,BOD_OFF,HS_OSC

Last edited:

#### Papabravo

Joined Feb 24, 2006
12,775
The configuration bits are "off" or "unprogrammed" when they are in the '1' state. If you look at the definition of the constants you'll see that they are all '1's except for a single '0' bit. When these constants are bitwise ANDed together, the desired '0' bits show up in the resulting constant that is programmed into the configuration word(s).

#### ErnieM

Joined Apr 24, 2011
8,011
as you know am new with PIC18f452.
Believe it or not we have no idea your skill set, just possibly a guess. Nor do we remember what tools you use, such as the compiler and other such things you are asking question about.

what is this meaning that these are being AND with one another .??
can i write all the configuration bit in a single line with the bits that AND with one another.
One can AND together several constants to set multiple or individual bits, or actually reset them. One could use an OR to set bits.

This device has some 33 config bits in 14 bytes. Do you really expect to set them all in a single line?

Open up the data sheet for this device and read section 19.1.

Open up the users guide for your compiler and check the section on config bits.

#### ect_09

Joined May 6, 2012
180
I don't think they are logically and in that context.
They might be in two lines because the bits are parts of two config bytes/words.

Are you using a BASIC or C compiler?
The midrange pic config in asm might look something like:
Code:
DEVICE LVP_OFF,BOD_OFF,HS_OSC
using HI-Tech compiler

#### ect_09

Joined May 6, 2012
180
Believe it or not we have no idea your skill set, just possibly a guess. Nor do we remember what tools you use, such as the compiler and other such things you are asking question about.

One can AND together several constants to set multiple or individual bits, or actually reset them. One could use an OR to set bits.

This device has some 33 config bits in 14 bytes. Do you really expect to set them all in a single line?

Open up the data sheet for this device and read section 19.1.

Open up the users guide for your compiler and check the section on config bits.
using Hi-Tech compiler
and i have a beginner level..
i know about AND gate for binary.
for example
Code:
          0101
AND  0011
ans      = 0001
OSCSDIS & HSPLL