If it helps, here is the C18 code to read a Sony remote. If you can program it on a stand alone chip you might be able to work out whats wrong.
Mike.
P.S. have you looked at an actual remote through the camera for comparison.
Mike.
Code:
#define IR_in PORTAbits.RA6 //define as needed
#define IR_tris TRISAbits.TRISA6
unsigned char GetPulse(void){
unsigned char count;
count=0;
IR_tris=1;
while(IR_in==1); //wait for high
while(IR_in==0){ //time low period
count++;
Delay100TCYx(1); //50uS assumes 8MHz
}
return count;
}
void GetIR(char *cmd,char *dev){
char i;
*cmd=0;
*dev=0;
while(GetPulse()<40); //wait for start pulse
for(i=0;i<7;i++){
*cmd=*cmd>>1;
if(GetPulse()>18)
*cmd|=0x40;
}
for(i=0;i<5;i++){
*dev=*dev>>1;
if(GetPulse()>18)
*dev|=0x10;
}
}
//you would call it by doing,
char command,device;
GetIR(&command,&device); //note pointers passed
//command and device are now valid.