Principle of 51 MCU decoding infrared remote control

Publisher:飘然出尘Latest update time:2016-08-03 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The TV remote control uses a dedicated integrated transmitter chip to transmit the remote control code, such as Toshiba TC9012, Philips SAA3010T, etc. Usually, the transmission of the color TV remote control signal is to modulate the control command and system code (a sequence composed of 0 and 1) corresponding to a certain button on a 38KHz carrier, and then amplify and drive the infrared transmitter to transmit the signal. Different companies' remote control chips use different remote control code formats. There are two common ones, one is the NEC standard and the other is the PHILIPS standard.

NEC standard: The frequency of the remote control carrier is 38KHz (duty cycle is 1:3); when a key is pressed, the system first transmits a complete full code. If the key is pressed for more than 108ms and is not released, the next transmitted code (continuous code) will only consist of the start code (9ms) and the end code (2.5ms). A complete full code = guide code + user code + user code + data code + data inverse code. Among them, the guide code is high level 4.5ms and low level 4.5ms; the system code is 8 bits, the data code is 8 bits, a total of 32 bits; the first 16 bits are the user identification code, which can distinguish different infrared remote control devices and prevent different models of remote control codes from interfering with each other. The last 16 bits are 8 bits of operation code and 8 bits of operation inverse code, which are used to check whether the data is received accurately. The receiving end makes a judgment on what action should be performed based on the data code. The continuous code is the code sent when the key is pressed continuously. It tells the receiving end that a certain key is being pressed continuously.

Transmission code representation under NEC standard51 MCU decoding infrared remote control principle - whimsical - whimsical blog

When transmitting data, 0 is represented by "0.56ms high level + 0.565ms low level = 1.125ms", and data 1 is represented by "high level 0.56ms + low level 1.69ms = 2.25ms"

That is, the transmission code "0" means transmitting 38khz infrared light for 0.56ms and stopping transmitting for 0.565ms, and the transmission code "1" means transmitting 38khz infrared light for 0.56ms and stopping transmitting for 1.69ms.

It should be noted that when the integrated receiving head receives a 38kHz infrared signal, the output terminal outputs a low level, otherwise it outputs a high level. Therefore, the waveform output by the integrated receiving head is the opposite of the transmitted waveform, as shown in the figure

          51 MCU decoding infrared remote control principle - whimsical - whimsical blog                    51 MCU decoding infrared remote control principle - whimsical - whimsical blog
51 MCU decoding infrared remote control principle - whimsical - whimsical blog51 MCU decoding infrared remote control principle - whimsical - whimsical blog
                                  
PHILIPS standard: carrier frequency is 38KHz; no simple code, when the key is pressed, the control code switches between 1 and 0, if the key is pressed continuously, the control code remains unchanged. A full code = start code '11' + control code + user code + user code, as shown in the figure. 51 MCU decoding infrared remote control principle - whimsical - whimsical blog
Data 0 is represented by "low level 1.778ms + high level 1.778ms"; data 1 is represented by "high level 1.778ms + low level 1.778ms". Continuous code repetition delay is 114ms.

The coding formats of NEC, TOSHIBA and SAMSONG have something in common: the remote control full code is composed of "boot code + system code + system code (or system code inversion) + data code + data code inversion"; the definition of data "0" and "1" is the same; the difference is that the duration of the high and low levels of the boot code is different, the number of system code bits is long or short, the delay between the first simple code and the last bit of the full code is different, and the boot pulse of the simple code is different; so the same part can be made into a general subroutine, including the subroutines "ON E" and "ZERO" that generate data "0" and "1", and the time control subroutines such as 9ms, 4.5ms, 2.25ms, 22ms, and 45ms.
Key value processing can use external interrupts. When a key is pressed, an interrupt request is sent to the CPU. Of course, this also includes the processing part of de-jittering and processing only one key when multiple keys are pressed at the same time.
The different states of the movement are distinguished and judged by the input values ​​of the four bits P3.5, P3.4, P3.1, and P3.0 of the single-chip microcomputer P3 port. For example, "0000" means working in the Toshiba TC90×× series state, and "0001" means working in the NEC PD61×× series state.
After determining which key is pressed and which state the movement is in, the program will strictly transmit the remote control code according to the corresponding remote control coding method, that is, modulate the level pulse of a certain period of time and a certain value on the 38KHz carrier and transmit them one by one.
The flow chart is shown in the figure

51 MCU decoding infrared remote control principle - whimsical - whimsical blog

Reference address:Principle of 51 MCU decoding infrared remote control

Previous article:"Pointers" in MCS-51 MCU assembly
Next article:Cx51 Standard Library Program Attribute Description

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号