btbass
Advanced Member level 5
It takes about 30mS to decode an RC5 transmission, which is a comparatively long time in terms of processor time.
Attached is a RC5 decoder project that is interrupt driven. It is written for a Pic16F690 although it should work with most pic16f variants.
It uses the external interrupt pin for the IR code stream, which on the 690 is RA2.
The internal oscillator is used and it is set to 8MHz.
It also uses timer 0. So timer 0 can't be used for anything else.
It only uses the negative edge interrupt so that minimum processor time is taken when decoding an RC5 data stream. It decodes the RC5 data using pulse lengths. The transmitted pulse time is calibrated on every transmission received, so should work with most RC5 handsets.
A lot of cheap handsets use ceramic resonators that are temperature sensitive, so the pulse times can vary widley from the RC5 spec.
Attached is a RC5 decoder project that is interrupt driven. It is written for a Pic16F690 although it should work with most pic16f variants.
It uses the external interrupt pin for the IR code stream, which on the 690 is RA2.
The internal oscillator is used and it is set to 8MHz.
It also uses timer 0. So timer 0 can't be used for anything else.
It only uses the negative edge interrupt so that minimum processor time is taken when decoding an RC5 data stream. It decodes the RC5 data using pulse lengths. The transmitted pulse time is calibrated on every transmission received, so should work with most RC5 handsets.
A lot of cheap handsets use ceramic resonators that are temperature sensitive, so the pulse times can vary widley from the RC5 spec.