im using C compiler for PIC.
at the start of my program there is this line
void main(void){
set the option register to 0
set INTCON to 0
set of commands follows here
set of commands follows here
set of commands follows here
set of commands follows here
...
...
...
}
it simulates ok. but when i tried it with the real hardware, it didnt work.
when i tried to set option register to 0xFF like this:
void main(void){
set the option register to 0xFF
set INTCON to 0
set of commands follows here
set of commands follows here
set of commands follows here
set of commands follows here
...
...
...
}
the program worked.
im just curious why it doesnt work when option register is set to 0? thanks in advance.
It depends really what your C compiler is doing?, but there is a PIC register named 'option', which is used to set tmr0, the prescaler, pullups on portb, and interrupts on portb.
But your compiler instructions should explain about it!.