I have some experience with PIC micro controllers ASM. But decided to move on to C. Having installed MPLABX IDE V3.55 and with the C compiler XC8. I now try to realize a program for PIC16F877A.
After initialization I try to set some output ports but there is no reaction in the simulator. When I try to change a port setting with a stimulus there is also no reaction. Where is the mistake?`
// Set PORTA and PORTE to digital
ADCON1 = 0B00000111;
// Turnoff PORTA comparitors
CMCON = 0B00000111;
// Set I/O PORTE
TRISE = 0B00000111;
// Set PORTB to input
TRISB = 0B11111111;
// Initialize temperature routine varables.
// minLimit = 0;
// MaxLimit = cycleTime;
// The switches SW1 - SW5 are pulled up against VDD
// When unpressed RE2 must be high
// Enter button SW3 open
PORTEbits.RE2 = 0x01;`
Even in watch I can not change the value. I can change the value in SFR.
Is it possible that I run into the R-M-W cycle problem?