Beginning of this page
Jump to main content

Please note that JavaScript and style sheet are used in this website,
Due to unadaptability of the style sheet with the browser used in your computer, pages may not look as original.
Even in such a case, however, the contents can be used safely.


The following page content corresponds to the products formerly marketed by NEC Electronics

Remote Control





NEC format for infrared remote control [Common]

FAQ-ID : com_remo-0101Last Updated : 2006/04

Q-1
How do the infrared remote control signals operate?
A-1
[Summary]
Infrared remote control uses an infrared ray with wavelength of approximately 950 nm to transmit several bytes of information at low speed. Although infrared rays are used to transmit binary (0/1) data, this is not simply a matter of representing binary values by the ON/OFF status of infrared rays.
An example of the NEC format is described below.

[General format]
The infrared remote control signal starts with a leader code.
Next comes a 16-bit custom code, then an 8-bit data code and an inverted binary 8-bit code, and finally a stop bit.

An example of the infrared remote control format is shown below.
This signal is followed by a frame space during which no infrared rays are emitted. The total frame length (including everything from the leader to the frame space) is 108 ms.

Example of NEC format for infrared remote control
Example of NEC format for infrared remote control

[Leader code]
The leader code stays ON for a 9-ms period, then is OFF for a 4.5-ms period. Since this part's waveform (timing) differs greatly from the following data code section, it makes the leader code easier to recognize.
(When repeating, the OFF period is only 2.25 ms, and the stop bit comes next, omitting the custom code and data codes.)

[Transmission data]
The custom code and data code sections contain the binary (0/1) data.
Data in each of these sections is transmitted LSB first (seeData transmission sequence below for details).

The binary (0/1) division of data is not based directly on infrared ON/OFF status but rather on the bit length (i.e., length of period when infrared rays are not being output).
Therefore, the length of the custom code section varies according to the data.
However, since inverted data corresponding to the data code is also transmitted, the total number of data bits "1" is eight and the data length is fixed for this section.

Difference between "0" and "1" data bit values in remote control signal
Difference between

Infrared rays are not output consecutively during the entire ON period. Instead, infrared ON periods repeatedly alternate with infrared OFF periods at a constant frequency (called the "carrier frequency"). The standard carrier frequency is 38 kHz.
The duty factor is 1/3.
These settings help minimize power consumption.

[Reasons for modulation in carrier frequency]
In ordinary (natural) use environments, various sources of infrared noise exist.
In order to work with signals amidst these noise sources, the transmitted infrared rays must exceed the noise level at the receiving side.

However, simply transmitting stronger infrared rays would increase power requirements.
To avoid this, a carrier frequency is used to modulate on/off periods of infrared transmission.
This enables stronger infrared rays to be transmitted at the same power consumption level.

The following diagram illustrates the difference when infrared transmission uses a carrier frequency.
When a carrier frequency is not used, the noise level is barely different. On the other hand, when a carrier frequency is used to boost the power during the peak periods only, the transmitted signals are stronger (at their peak) than the noise level even though the total power is the same.
Using a carrier frequency with alternating on/off periods enables a filter on the receiving side to filter out components that are not frequency components, which further increases the margin of the signal to noise.

Relationship between remote control signals and noise in regard to carrier frequency modulation
Relationship between remote control signals and noise in regard to carrier frequency modulation

This method works because the timing (intervals) is used to indicate binary (0/1) data values.

[Data transmission sequence]
The structure of remote control signal transmitted via this method consists of custom code and data code.

The custom code, which is transmitted first, is 16 bits long but it is divided into two 8-bit sections.
In early versions of remote control devices, the custom code was only 8 bits long (C0 to C7), and the logically inverted data (C'0 to C'7) was transmitted via the next 8 bits.
Now this C'0 to C'7 section has been reassigned as the second section of the custom code so that the custom code is 16 bits long.
(16-bit data is specified as the sum of custom code = xx + custom code' = yy.)

When transmitting, the custom code is output LSB first (C0 to C7), then the custom code' is output LSB first (C0' to C7').

Transmission sequence of custom code section
Transmission sequence of custom code section

The data being transmitted is 8-bit data.
The logically inverted 8-bit data is transmitted continuously, so a total of 16 bits are used to transmit the data.
When this data is received, the inverted 8-bit data code should be checked as being the logical inversion of the first 8-bit data code, as a means of error checking.

Transmission sequence of data code sections
Transmission sequence of data code sections

Is this information useful for you ?

Q-2
How are the remote control signals received (what is the analog processing at the receiving side)?
A-2
When remote control signals are received, these infrared signals have become more dispersed and weaker (the receptor photo diode's output has a P-P value of several dozen μV), so a preamplifier must be used to amplify the infrared receptor photo diode's output.

Also, a bandpass filter is used to extract only the carrier frequency components, which are then detected and processed by a waveform shaper to obtain more accurate remote control signals.
The type of remote control signal can be determined by measuring each signal's on/off periods.

A special-purpose preamplifier is used to simplify implementation of processing from preamplification to waveform shaping.

Example of infrared remote control receiver logic
Example of infrared remote control receiver logic

Is this information useful for you ?

Q-3
How are remote control codes received and interpreted?
A-3
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
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.

Is this information useful for you ?


What is the NEC format? [Common]

FAQ-ID : com_remo-0102Last Updated : 2006/04

Q-1
What is the NEC format for infrared remote control transmission?
A-1
The key features of the NEC format for infrared remote control transmission are:

  - Uses a 38-kHz carrier frequency
  - Leader code interval is 9 ms + 4.5 ms
  - Uses 16-bit custom code
  - Uses 8-bit data code and 8-bit inverted data code

For details, see the remote control microcontroller's data sheet.

Also refer to the following FAQ item: NEC format for infrared remote control [Common]

Is this information useful for you ?

Q-2
What is custom code?
A-2
Custom code is used to identify infrared remote control users. In the NEC format, this is a 16-bit code that is inserted before the data code.

Also refer to the following FAQ item: NEC format for infrared remote control [Common]

Is this information useful for you ?


Use of NEC format

FAQ-ID : com_remo-0002Last Updated : 2006/04

Q-1
Are the custom code and NEC format guaranteed to ensure error-free operation in all environments worldwide?
If so, how is this done?
A-1
NEC simply ensures that there is no duplication of codes assigned in NEC format.
We cannot do this for all codes being used in all remote control devices, so there can be no worldwide guarantee against interference or operation faults.

Is this information useful for you ?

Q-2
Is the NEC format being used in chips made by other companies?
A-2
There are some universal remote control devices (with learning function) that output using the NEC format.

Is this information useful for you ?

Q-3
Aren't those other companies infringing on NEC's intellectual property rights?
A-3
We are not particularly concerned about intellectual property rights in this case.
The issue instead is compatibility among various companies' chips that use the same code.

Is this information useful for you ?

Q-4
So the NEC format cannot be used without using custom code?
A-4
No, the custom code's 00XXH section can be freely used.
However, there are risks when other devices use this same code.

Is this information useful for you ?


Acquiring a custom code

FAQ-ID : com_remo-0001Last Updated : 2006/04

Q-1
There is a product model that uses the uPD6122 chip with a custom code, but this model is no longer in production.
I understand that new product models are being planned, and there are plans to use some new kind of custom code while preserving compatibility with the previous custom code.
Will it be easy to obtain one of these new custom codes?
A-1
Basically, each of our corporate clients receives a unique custom code.
Due to the limited number of such codes, we cannot provide several custom codes to the same company.
Any previously issued custom code will remain valid and should be used.

Is this information useful for you ?

Q-2
My company is planning to manufacture products that use remote control devices.
How can I apply for a custom code?
A-2
Applications for custom codes can be submitted via our product sales channels.
To apply, contact an authorized NEC Electronics sales representative.

Please submit the following information with your application.
- Name of target device
- Name of your company
- Address of your company
- Name of applicant
- Contact information
- Information about target device:
    Product component names
    continuous use period
    expected monthly production volume

Is this information useful for you ?

Q-3
We are planning to make products that use remote control devices, but we also plan to outsource the manufacturing.
How do we apply for a custom code in this case?
A-3
Apply for your custom code via the channel via which the actual device will be purchased.

Is this information useful for you ?


How much of an error margin is there for the carrier frequency? [Common]

FAQ-ID : com_remo-0004Last Updated : 2006/04

Q-1
My remote control-equipped microcontroller's data sheet says that the carrier frequency is 38 kHz, but it does not mention what the allowable error is. Neither does it say anything about an allowable error for the data code periods.
A-1
There are no rated allowable error for the NEC format.
However, a normal variation range of about 2 kHz (5%) is assumed.

The question of how much variation can be tolerated when actually using the device depends also on the error margin on the receiving side.
Check what this margin is in your own system.
This same margin (%) can then be applied to the data code periods.

Is this information useful for you ?


Does NEC Electronics make remote control receivers?

FAQ-ID : com_remo-0005Last Updated : 2006/04

Q-1
In addition to NEC format remote control transmitter devices, does NEC Electronics also make receivers?
A-1
No, we do not make such receivers.
Ordinarily, the microcontroller that controls the system performs such reception processing, so there are no specialized receivers for that.

Also refer to the following FAQ item: NEC format for infrared remote control [Common]

Is this information useful for you ?


Standard device for NEC format

FAQ-ID : com_remo-0006Last Updated : 2006/04

Q-1
Are they any ready-made, standard devices that can transmit in NEC format?
A-1
Unfortunately, there are not.
A reference program can be provided. Contact your local NEC Electronics sales representative.

Is this information useful for you ?


Sample program for receiving infrared remote control signals

FAQ-ID : com_remo-0007Last Updated : 2006/04

Q-1
Are there any sample programs for receiving infrared remote control signals in NEC format?
A-1
For sample programs, consult an NEC Electronics sales representative.

Also refer to the following FAQ item for reception processing: NEC format for infrared remote control [Common]

Is this information useful for you ?