Cantafford
Member
Hello,
I'm trying to write a simple code in MPLAB X Ide for PIC16F876A using XC8 compiler. When I try to run the code it won't recognize my LATC registers. The microcontroller does have the TRISC registers as specified in the datasheet. Yet I get this error on any line I try to use TRISC:
"main.c:79: error: (192) undefined identifier "LATCbits""
Also I'm getting this error:
main.c:80: error: (196) struct/union required
For this line:
if(var==1) {LATCbits.LATC0 = 0; LATCbits.LATC1 = 1;} // left
What does that mean? I wrote this code for a PIC18F2550 and it worked just fine. Now I'm getting those errors but I'm not using any register name that is not in the datasheet. Also for the second error the syntax is the same so I don't think I should get an error. Yet why are the errors there?
I'm trying to write a simple code in MPLAB X Ide for PIC16F876A using XC8 compiler. When I try to run the code it won't recognize my LATC registers. The microcontroller does have the TRISC registers as specified in the datasheet. Yet I get this error on any line I try to use TRISC:
"main.c:79: error: (192) undefined identifier "LATCbits""
Also I'm getting this error:
main.c:80: error: (196) struct/union required
For this line:
if(var==1) {LATCbits.LATC0 = 0; LATCbits.LATC1 = 1;} // left
What does that mean? I wrote this code for a PIC18F2550 and it worked just fine. Now I'm getting those errors but I'm not using any register name that is not in the datasheet. Also for the second error the syntax is the same so I don't think I should get an error. Yet why are the errors there?