J Jyothi@Pic New Member Jan 12, 2009 #1 Hi, my code is #ifndef BITNUM #define BITNUM(adr, bit) ((unsigned)(&adr)*8+(bit)) /* used for port defs*/ #endif static bit CH_OUT @ BITNUM(PORTC,4); static bit ra1=0; void main() { CH_OUT=~(ra1); } This code is written in PICCLITE compiler i am getting an error The error is" illegal operation on bit variable" can any body tell how to use biwise operator in PICCLITE compiler for PIC16F877A
Hi, my code is #ifndef BITNUM #define BITNUM(adr, bit) ((unsigned)(&adr)*8+(bit)) /* used for port defs*/ #endif static bit CH_OUT @ BITNUM(PORTC,4); static bit ra1=0; void main() { CH_OUT=~(ra1); } This code is written in PICCLITE compiler i am getting an error The error is" illegal operation on bit variable" can any body tell how to use biwise operator in PICCLITE compiler for PIC16F877A
P Pommie Well-Known Member Most Helpful Member Jan 12, 2009 #2 I'm not familiar with that compiler but tilde (~) is normally the twos complement and so ~0 = 0xff. Try CH_OUT=!(ra1); Mike.
I'm not familiar with that compiler but tilde (~) is normally the twos complement and so ~0 = 0xff. Try CH_OUT=!(ra1); Mike.