RC5 Protocol is a standard infrared data communication protocol used in remotes of consumer electronic systems like TV, music players etc. This protocol was developed by Philips but has been adopted by a lot of other companies for their consumer electronic remotes.
Before understanding the RC-5 protocol it is important to understand the use of infra-red radiations for communication and control applications. The main advantage of infra-red is that it is easily generated and does not suffer electromagnetic interference. A transmitter or source converts an electrical signal to an optical signal. The handset of a consumer electronic remote contains a keypad and a transmitter integrated circuit (IC) driving an infra-red LED.
Since a lot of devices generate infra-red radiations (like lamps, stove etc.) it is important to make sure that these signals don’t interfere with the transmitter signal and therefore the RC-5 protocol uses bi-phase (aka Manchester coded) command data bi-stream modulating a 36 kHz carrier. It uses a fixed length and fixed quantity of bits. For the receiving device (in our case the TV) to understand and can act upon the received signal, the signal must be is amplified, filtered, and demodulated. This is done with the help of an infrared receiver which is a specialized IC with an integral photo-diode. The command comprises of 14 bits of equal length (1.778 ms).The half of the bit time is filled with a burst of the 36 KHz carrier and the other half is idle. A logical zero (OFF) has a burst in the left side of the bit time and a logical one (ON) has burst in the right side of the bit time.
The first bit is the start bit used for Automatic Gain Calibration (AGC) of the receiver.
A field bit, which denotes whether the command sent, is in the lower field (logic 1 = 0 to 63 decimal) or the upper field (logic 0 = 64 to 127 decimal). The field bit was added later by Philips when it was realized that 64 commands per device were insufficient. Previously, the field bit was combined with the start bit. Many devices still use this original system. (source wiki)
The third bit is TOGGLE BIT or CHECK BIT, which flips state every time you press a key on the remote.
This key helps to make sure that you select the channel “22” only when you press the key 2 twice and not when you hold the key 2 continuously.
The next five bits are called the ADDRESS BITS and are used to select one of the 32 possible systems. Each system has a unique 5 BIT address.
The next 6 bits are COMMAND BITS. These bits along with the field bit are used to give one of the 128 possible instructions to the receiver device. Bit #14 is the LESS SIGNIFICANT BIT, and it is transmitted last.
The major advantage of a handset using the RC-5 protocol is that you can control a TV of any brand with it.
When a key is pressed on the remote controller, the message frame transmitted consists of the following 14 bits, in order:
- two Start bits (S1 and S2), both logical ’1′.
- a Toggle bit (T). This bit is inverted each time a key is released and pressed again.
- the 5-bit address for the receiving device
- the 6-bit command.
The address and command bits are each sent most significant bit first. Figure 1 illustrates the format of a Philips RC5 IR transmission frame, for an address of 05h (00101b) and a command of 35h (110101b).
- 5.334ms to transmit the Start and Toggle bits (S1, S2 and T). Notice that, as the first half-bit of S1 is a space, the receiver will only notice the real start of the message frame after 889us.
- 8.89ms to transmit the 5 bits for the address
- 10.668ms to transmit the 6 bits for the command
- 24.892ms to fully transmit the actual message frame.