void interrupt high_priority ccp2(void){
if(CCP2IF==1){
if(CCP2M0==1){
//pin has just gone low so do delay
CCP2M0=0;
CCPR2+=20000-ServoPos;
}else{
CCP2M0=1;
CCPR2+=ServoPos;
}
CCP2IF=0;
}
}
It's just an interrupt driven servo output.
I wanted to see the actual code produced and so opened the disassembly listing.
This is what I saw,
Now the line, CCPR2+=20000-ServoPos can't compile to one line MOVLW 0x20.
So, does anyone know how to get MPLAB X to show all the generated code?
If servopos isn't being used fully yet, ie... if you set it to an initial position, and then don't use it, then it will evaluate it as a constant and two constants make one constant....
turn off optimization to view the generated code..