Using bitwise AND for setting configuration bits? What's all this about
- From: "Tomás Ó hÉilidhe" <toe@xxxxxxxxxxx>
- Date: Fri, 29 Feb 2008 09:50:27 -0800 (PST)
I've been programming the PIC16F684 for a few weeks now, and only
today did I notice the peculiarity of how the configuration bits were
being set:
__CONFIG(FCMDIS & IESODIS & BORDIS & UNPROTECT & MCLRDIS & PWRTEN &
WDTDIS & INTIO);
I would have expected bitwise OR to be used in conjunction with macros
that equate to an exact power of 2, like as follows:
#define FCMDIS 1
#define IESODIS 2
#define BORDIS 4
#define UNPROTECT 8
#define MCLRDIS 16
#define PWRTEN 32
__CONFIG(FCMDIS | IESODIS | BORDIS | UNPROTECT | MCLRDIS | PWRTEN |
WDTDIS | INITO);
Can anyone shed any light on their usage of bitwise AND for setting
config bits?
.
- Follow-Ups:
- Re: Using bitwise AND for setting configuration bits? What's all this about
- From: FreeRTOS.org
- Re: Using bitwise AND for setting configuration bits? What's all this about
- Prev by Date: Re: SPI controlled registers in peripheral chips question.
- Next by Date: Re: Chuck Falconer top posting again
- Previous by thread: NGW100; Display solution ?
- Next by thread: Re: Using bitwise AND for setting configuration bits? What's all this about
- Index(es):
Relevant Pages
|
|