Datasheet

Jon Waddington
48
3.9.1 IR receiver
The Infra-Red receiver circuit is based on a Sharp GP1UX301QS IR receiver. The device
is tuned to detect bursts of IR signals at 40KHz which is capable of detecting 36KHz
signals.
Figure 3.9.1 shows the circuit diagram for the IR receiver. The output of the receiver is
the demodulated IR signal and is connected to pin 2 of the Propeller chip where it is
decoded by the program.
The signal from the IR receiver is inverted from the theoretical waveform so a high to
low transition is a logic ‘1’ and a low to high transition is a logic ‘0’.
The code below shows the initialization of the RC5 object. It is initialized by calculating
the number of clock cycles in a full bit period, three quarters of a bit period, half of a bit
period and a quarter of a bit period, based on the clock frequency. The frequency of the
RC5 codes is 1/1.778ms which is approximately 562. Multiplying this by the frequen cy of
the Propeller’s clock gives the number of clock pulses between each bit period.
The code then begins the RC5 cog.
PUB init (pin)
{{Launch cog to detect RC5 codes}}
rxmask := |< pin 'mask input pin
full := (clkfreq/562) 'calculate bit times
thalf := full >> 1
quart := thalf >> 1
tquart := (thalf + quart)
cognew(@go, @rc5) 'begin RC5 cog
Figure 3.9.1. Circuit Diagram showing the Infra-Red Receiver