A remote control receiver for the Packard Bell fast media remote control using either hc11 or 8051 microprocessors.
Uses common Sharp Infrared receiver (not the supplied receiver)
Minimal other components
Uses interrupts to reduce processor load
Version 2.0 include pjr3mp3 player strings (here)
Download source here
Written in assembly for hc11 and 8051
Designed as a library module to be added to a larger project eg MP3 Player
Compiles on linux (untested on win32)
hc11 version uses gcc for the hc11
8051 version uses the sdcc assembler asx8051
hc11 version measures high and low pulse lengths to decode data, 8051 version measures period only
Supplied as an example program that outputs a string to the serial port for each key pressed
Licensed under the GPL
hc11 version uses IC3/PA2 as an input (can be changed to IC1 or IC2 through minor code changes)
8051 version uses INT0
Requires pull-up resistor to +5V and optional filter capacitor from 0V to 5V.
Example circuit from mp3 player IR remote shown below
Example assembly shown below - I have reused the receiver case and glued a Sharp receiver inside
The Packard Bell remote control has 3 elements to its communication protocol.
Preamble (~12.8 ms period)
Short Zero value pulse (~1 ms period)
Long One value pulse (~2.4 ms period)
--* *------------------* *-------* *-------* | | | | | | | | | | | | | | *----------------* *-------* *---------------* *-- ^ ^ ^ ^ | preamble | zero | one |
When a key is pressed the remote control sends a preamble followed by 32 bits of information encoded using these pulse timings. Examples of these pulses can be seen below as logic analyser screen dumps (the glitches are bugs in the Logic analyser software).
The 32 bits of information are made up of four bytes, 2 bytes of remote control ID and 2 bytes of button ID received MSB first in this order. The second of each pair of bytes is always the complement of the first (as a basic form of checksum).
The remote control ID is always 08, thus the first two bytes are always 08 F7 hex. Thus the 32 bit data for the Help button (Button ID of 20 hex) would look like 08 F7 20 DF encoded as above. Codes for all keys are shown in the image below (click on it for a larger version)
The code shown above decodes these codes. It measures the incoming pulses looking first for a preamble of the right length and then looking for valid data encoding to extract the code for the pressed button. The hc11 version works off the inverted code (second byte), the 8051 works off the first.