Skip to main content
Renesas Electronics America - Knowledgebase

How are remote control codes received and interpreted?

Latest Updated:04/01/2006


How are remote control codes received and interpreted?


Signal edges are used to measure the length of each signal period in order to interpret the received remote control signals.
Since the data that is output from the infrared remote control preamplifier is negative-logic data, these signals are described below as negative-logic input signals.

Leader code section
Since there is a 9-ms ON period for the leader code, an edge-triggered interrupt function or a program-driven polling function is used to detect the falling edge (A) of the input signal, and then the period between the falling edge and the next rising edge is measured.
At the same time, the timer's capture function can also be used to detect the rising edge (B) of the input signal and measure the period between edges.
As a countermeasure against operation errors, the periods that are measured in this way can be judged as to whether or not they are within the normal range as leader code signals, and they can also be used to determine whether or not reception is possible even when the remote control device's battery power is low.

In other formats, the leader code's ON period is about 8.5 ms, so a period of at least 8.7 ms must be used when seeking to detect only this period and the header code. A smaller value is used when seeking to detect the entire frame.

The following describes how the period to the next falling edge (C) is measured. Basically, the following two types of periods are measured (see the figure below), and a period of at least 3.4 ms (the mid point between 4.5 ms and 2.25 ms) is the criteria used to distinguish between normal leader code and repeat leader code.
When the code is repeat code, the frame space is checked next.



Periods in leader code

(2) Custom code and data code sections
After detection of the leader code is completed, the custom code and data codes are detected.
Although both the ON and OFF periods must be checked to ensure precision, the data value (0 or 1) can be judged simply by checking the period until the next falling edge (the single-bit period).
Since this judgment regards 2.25 ms as data value "1" and 1.125 ms as data value "0", it is simplest to distinguish these using a mid point value.

However, limit values should also be used when checking, since extra long intervals may be interpreted as meaning that data has just been transmitted via a different format.
In this case, it is important to precisely check for 32-bit signals.
Once a 32-bit signal has been detected, the frame space is checked next.

(3) Frame space
Although the most precise way to check the frame space would be to check for a total frame period of 108 ms, in this case it suffices to simply check whether or not the data length exceeds 32 bits.
Once a 32-bit data is received, a custom code, data code, and inverted data code check should be performed.


Suitable Products