void main()
{
set_tris_A(0xFF);
set_tris_B(0xFF);
set_tris_C(0x00);
setup_timer_0(RTCC_DIV_16|RTCC_Internal); //Timer 0 Setup, counts up with 62,5kHz
//Teilung: When the counter has the value 1, 16us have left

delay_ms(80); //80ms delay to wait for the beginning of the next signal
enable_interrupts(int_ext); //allow ext Interrupt on Pin B0
flag=0; //Set The Interrupt Flag to Zero to get out of the cycle
abtast=75; //The Timer Value 75 is the same as 1,2 ms and i need that time to scan my bit in the 3/4 bit size
i=0;
}
}
}
___________________________
This message was ported from CCS's old forum
Original Post ID: 10758

PCM programmer

Joined: 06 Sep 2003Posts: 20477

Re: Manchester Decoding [RC5 Code for Philips Remote Control

Posted: Fri Jan 17, 2003 12:27 pm

:=while(flag=1)

:=code<<1;
--------------------------------------------------

Both of the lines above are incorrect.
You must learn to spot these kinds of errors.

I'm struggling with good way to say this:
Programming will not become easy until you
learn to avoid these kinds of errors.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10760

Hans WedemeyerGuest

Re: Manchester Decoding [RC5 Code for Philips Remote Control

Posted: Fri Jan 17, 2003 1:14 pm

I second that.
He has bugged me at home, and I keep telling him about this line of code... I'm sure he just wants someone to write it all for him!

The line of code is commented with //disable interrupt on Pin B0 [until the next signal

Another interrupt is never going to happen !

#int_ext //allow ext interrupt
isr() //Interrupt Service Routine
{
disable_interrupts(int_ext); //disable interrupt on Pin B0 [until the next signal
set_timer0(0); //Set Timer 0 to zero
flag=1; //Set Interruptflag to 1
}
:=:=while(flag=1)
:=
:=:=code<<1;
:=--------------------------------------------------
:=
:=Both of the lines above are incorrect.
:=You must learn to spot these kinds of errors.
:=
:=I'm struggling with good way to say this:
:=Programming will not become easy until you
:=learn to avoid these kinds of errors.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10761

R.J.HamlettGuest

Re: Manchester Decoding [RC5 Code for Philips Remote Control

Posted: Fri Jan 17, 2003 2:47 pm

:=I second that.
:=He has bugged me at home, and I keep telling him about this line of code... I'm sure he just wants someone to write it all for him!
:=
:=The line of code is commented with //disable interrupt on Pin B0 [until the next signal
:=
:=Another interrupt is never going to happen !
:=
Yes. He has used some code I posted, and not added the stuff needed (and mentioned in the comments), to make it work. He needs to clear the interrupt flag, and re-enable the interrupts once the last bit of the current character is received.
Combined with the syntax errors it makes sure the code won't work...

Best Wishes

:=#int_ext //allow ext interrupt
:=isr() //Interrupt Service Routine
:={
:=disable_interrupts(int_ext); //disable interrupt on Pin B0 [until the next signal
:=set_timer0(0); //Set Timer 0 to zero
:=flag=1; //Set Interruptflag to 1
:=}
:=:=:=while(flag=1)
:=:=
:=:=:=code<<1;
:=:=--------------------------------------------------
:=:=
:=:=Both of the lines above are incorrect.
:=:=You must learn to spot these kinds of errors.
:=:=
:=:=I'm struggling with good way to say this:
:=:=Programming will not become easy until you
:=:=learn to avoid these kinds of errors.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10762