Flexible infrared protocol modulation method and remote control terminal

By combining the PWM and DMA modules of the microcontroller and the infrared transmitting module, flexible infrared protocol modulation is achieved, solving the problem of high CPU resource consumption in infrared communication chips, realizing hardware infrared transmission function, and applicable to multiple infrared protocols.

CN117690280BActive Publication Date: 2026-06-16LINGSI MICROELECTRONICS (XIAMEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LINGSI MICROELECTRONICS (XIAMEN) CO LTD
Filing Date
2023-11-27
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

Existing infrared communication chip designs lack independent hardware infrared function modules, resulting in high CPU resource consumption, affecting the real-time performance of wireless communication, and the hardware is incomplete, requiring the use of other modules to achieve infrared transmission.

Method used

A microcontroller and an infrared transmitting module are used. The infrared protocol modulation is implemented using a PWM module and a DMA module. The configuration word of the electrical pulse sequence is directly transmitted to the I/O port of the PWM module through the microcontroller's DMA module, which drives the infrared transmitting module to send the infrared protocol.

🎯Benefits of technology

It alleviates CPU resource consumption, realizes hardware infrared transmission function, is suitable for chips without independent hardware infrared function module, and has robustness and applicability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117690280B_ABST
    Figure CN117690280B_ABST
Patent Text Reader

Abstract

The application discloses a flexible infrared protocol modulation method and a remote control terminal, which comprises a single-chip microcomputer and an infrared emission module, wherein the single-chip microcomputer is provided with a PWM module and a DMA module; the single-chip microcomputer configures a carrier cycle and a duty cycle of the infrared protocol; the single-chip microcomputer encodes infrared protocol data into an electric pulse sequence configuration word corresponding to the PWM module; the DMA module sends the electric pulse sequence configuration word to an I / O port corresponding to the PWM module; and the I / O port corresponding to the PWM module drives the infrared emission module to emit a specific infrared protocol. The application encodes the infrared protocol into the electric pulse sequence configuration word corresponding to the PWM module, sends the electric pulse sequence configuration word to the infrared emission module by the DMA module to emit the specific infrared protocol, alleviates the consumption of CPU resources, and realizes the hardware infrared sending function by the PWM module of the single-chip microcomputer cooperating with the DMA module, so that the application has certain applicability and robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of infrared communication technology, and in particular to a flexible infrared protocol modulation method and a remote control terminal. Background Technology

[0002] Infrared remote control is a common wireless, non-contact control technology in daily life. A complete infrared remote control system generally consists of two parts: infrared transmission (modulation) and infrared reception (demodulation). It has the characteristics of strong anti-interference ability, reliable information transmission, low cost, low power consumption, and simple implementation principle, and is widely used in electronic devices such as household appliances.

[0003] Existing infrared functionality is generally implemented in either software or hardware. Software-based infrared functionality consumes CPU resources and can affect some wireless protocols with high real-time communication requirements. For example, using software-based infrared functionality when Bluetooth is already connected will impact BLE (Bluetooth Low Energy) communication timing. Hardware-based infrared functionality requires an independent infrared module added during chip design, allowing the infrared transmission timing to be entirely handled by hardware. While theoretically possible, in reality, manufacturers often omit this independent hardware infrared module to save costs or design space. Without this additional hardware module, infrared transmission timing cannot be achieved independently, resulting in incomplete infrared functionality in most wireless communication chips. They require other infrared-related modules to function, representing a design flaw.

[0004] Based on the aforementioned situation where the hardware is imperfect but still needs to reduce CPU utilization, the inventors, through careful research on infrared communication technology, have overcome the shortcomings of existing technologies and developed a flexible infrared protocol modulation method and remote control terminal. Summary of the Invention

[0005] The purpose of this invention is to provide a flexible infrared protocol modulation method to reduce the consumption of CPU resources and make up for design defects in the initial chip design.

[0006] The present invention also provides a remote control terminal including a flexible infrared protocol modulation method.

[0007] To achieve the above objectives, the solution of the present invention is as follows: a flexible infrared protocol modulation method, comprising a microcontroller and an infrared transmitting module, wherein the microcontroller is equipped with a PWM module and a DMA module; the microcontroller configures the carrier period and duty cycle of the required infrared protocol according to the actual application; the microcontroller encodes the infrared protocol data into a corresponding PWM module electrical pulse sequence configuration word; the DMA module sends the electrical pulse sequence configuration word to the I / O port corresponding to the PWM module; the I / O port corresponding to the PWM module drives the infrared transmitting module to emit a specific infrared protocol.

[0008] In a preferred embodiment, the step of encoding the infrared protocol data into the corresponding PWM module electrical pulse sequence configuration word is as follows:

[0009] (1) Configure the carrier period and duty cycle of PWM according to the infrared protocol;

[0010] (2) The number of effective pulse repetitions is obtained based on the unit effective pulse time and carrier period of the infrared protocol;

[0011] (3) According to the way the infrared protocol expresses logic "1" and logic "0", logic "1" or logic "0" is composed of several effective carrier pulses and several empty carrier pulses. Among them, a single effective carrier pulse is composed of several pulse waves with the duty cycle described in step (1), and the number of several single effective carrier pulses is the same as the number of repetitions of the effective pulse in step (2). A single empty carrier pulse is composed of several pulse waves with a duty cycle of 0. Thus, the electrical pulse sequence configuration word of logic "1" or logic "0" is {......, effective carrier pulse duty cycle,......, empty carrier pulse duty cycle,......}.

[0012] In a preferred embodiment, the remote control terminal includes a microcontroller and an infrared transmitting module, and executes a flexible infrared protocol modulation method according to any one of claims 1 to 2 during infrared protocol modulation.

[0013] The beneficial effects of the present invention after adopting the above scheme are as follows: The present invention encodes the required infrared protocol into a corresponding microcontroller PWM module electrical pulse sequence configuration word, and uses the microcontroller DMA module to send the electrical pulse sequence configuration word to the infrared transmitting module to emit a specific infrared protocol. In this process, the DMA module directly transmits data without temporarily interrupting the CPU process, thus alleviating the consumption of CPU resources. When the chip does not have an independent hardware infrared function module and is unwilling to simulate infrared function through software mode, the present invention encodes the infrared protocol data into the electrical pulse sequence configuration word corresponding to the PWM module through the microcontroller, and uses the DMA module to transmit data, thereby realizing the hardware infrared transmission function. The module on the microcontroller makes up for the design defects at the beginning of the chip design, and has a certain degree of applicability and robustness. Attached Figure Description

[0014] Figure 1 This is a flowchart illustrating the present invention;

[0015] Figure 2 This is a schematic diagram of the infrared encoded frame format according to an embodiment of the present invention;

[0016] Figure 3 This is the PWM configuration table of this invention embodiment;

[0017] Figure 4 This is a schematic diagram of a sequence according to an embodiment of the present invention. Detailed Implementation

[0018] like Figure 1 As shown, this invention provides a flexible infrared protocol modulation method, including a microcontroller and an infrared transmitting module. The microcontroller is equipped with a PWM module and a DMA module. The method includes the following steps: determining the infrared protocol required for the actual application; the microcontroller configuring the carrier period and duty cycle of the required infrared protocol according to the actual application; the microcontroller performing an electrical pulse sequence configuration word operation, encoding the infrared protocol data into a corresponding PWM module electrical pulse sequence configuration word; sending the electrical pulse sequence configuration word out; the DMA module sending the electrical pulse sequence configuration word to the I / O port corresponding to the PWM module; and executing infrared transmission, whereby the I / O port corresponding to the PWM module drives the infrared transmitting module to emit a specific infrared protocol.

[0019] The steps for encoding the infrared protocol data into the corresponding PWM module electrical pulse sequence configuration word are as follows:

[0020] (1) Configure the carrier period and duty cycle of PWM according to the infrared protocol;

[0021] (2) The number of effective pulse repetitions is obtained based on the unit effective pulse time and carrier period of the infrared protocol;

[0022] (3) According to the way the infrared protocol expresses logic "1" and logic "0", logic "1" or logic "0" is composed of several effective carrier pulses and several empty carrier pulses. Among them, a single effective carrier pulse is composed of several pulse waves with the duty cycle described in step (1), and the number of several single effective carrier pulses is the same as the number of repetitions of the effective pulse in step (2). A single empty carrier pulse is composed of several pulse waves with a duty cycle of 0. Thus, the electrical pulse sequence configuration word of logic "1" or logic "0" is {......, effective carrier pulse duty cycle,......, empty carrier pulse duty cycle,......}.

[0023] The process of configuring the above-mentioned electrical pulse sequence will be further explained below using the NEC protocol as an example.

[0024] like Figure 2 The image shows the infrared coded frame format of the NEC protocol. For the NEC protocol, the control method of logic "1" is: first transmit a 560us effective carrier pulse signal, then transmit a 1690us empty carrier pulse signal, with a total transmission time of 2.25ms; the control method of logic "0" is: first transmit a 560us effective carrier pulse signal, then transmit a 560us empty carrier pulse signal, with a total transmission time of 1.12ms.

[0025] like Figure 2 and Figure 3 As shown, taking the NEC protocol as an example, its carrier frequency is 38KHz, the carrier period is 26.3us, the unit effective pulse time is 560us, and the duty cycle can be 1 / 3 to 1 / 4. The duty cycle used in this embodiment is 1 / 3.

[0026] As described in step (1), the carrier period and duty cycle of the PWM are configured according to the parameters of the ENC protocol, that is, the carrier period is 1 / 38KHz, which is approximately 26us, and the duty cycle is 26 / 3, which is approximately 8.

[0027] As described in step (2), the number of effective pulse repetitions is obtained based on the unit effective pulse time and carrier period of the NEC protocol. That is, the unit effective pulse time is the fixed parameter of 560us of the NEC protocol, and the number of effective pulse repetitions is 560 / 26, which is approximately equal to 21.

[0028] As described in step (3), the logic "1" of the NEC protocol consists of 1 valid carrier pulse and 3 empty carrier pulses. The single valid carrier pulse consists of 21 consecutive pulse waveforms with a duty cycle of 1 / 3, and the single empty carrier pulse waveform consists of 21 consecutive pulse waveforms with a duty cycle of 0. The number of pulse waveforms of a single valid carrier pulse is obtained from step (2), and the duty cycle of a single valid carrier pulse is obtained from step (1). Therefore, the electrical pulse sequence configuration word for the logic "1" of the NEC protocol can be represented as {valid carrier pulse duty cycle, empty carrier pulse duty cycle, empty carrier pulse duty cycle, empty carrier pulse duty cycle}, i.e. {8,0,0,0}. Similarly, a logic "0" in the NEC protocol consists of one valid carrier pulse and one empty carrier pulse. A single valid carrier pulse comprises 21 consecutive pulse waveforms with a duty cycle of 1 / 3, and a single empty carrier pulse waveform comprises 21 consecutive pulse waveforms with a duty cycle of 0. Therefore, the electrical pulse sequence configuration word for a logic "0" in the NEC protocol can be represented as {valid carrier pulse duty cycle, empty carrier pulse duty cycle}, i.e., {8, 0}. Since the infrared protocol has a certain fault tolerance, the above parameters, after approximation, do not affect the actual usage effect.

[0029] like Figure 4 As shown, if the microcontroller needs to output a hexadecimal data 0xB5, its binary representation is 0b10110101. Taking the NEC protocol as an example, the "1" or "0" on the binary bits are sequentially processed according to the above rules of logic "1" and logic "0" to perform electrical pulse sequence configuration word operation. That is, the electrical pulse sequence configuration word of 0b10110101 can be represented as {8,0,0,0,8,0,8,0,0,0,8,0,0,0,8,0,8,0,0,0,8,0,8,0,0,0}. Finally, the electrical pulse sequence configuration word is output to the I / O port of the PWM module through the DMA module.

[0030] The remote control terminal of the present invention includes a microcontroller and an infrared transmitting module. When performing infrared protocol modulation, it executes the above-described flexible infrared protocol modulation method. The remote control terminal can adapt to a variety of different infrared protocols. The remote control terminal includes, but is not limited to, remote controllers and smart speakers.

[0031] In this specification, "several" means one or more, "multiple" means two or more, "greater than", "less than", "exceeding" are understood to exclude the number itself, and "above", "below", "within" are understood to include the number itself.

[0032] The above description is only a preferred embodiment of the present invention and is not intended to limit the design of this case. All equivalent changes made based on the key design features of this case shall fall within the protection scope of this case.

Claims

1. A flexible infrared protocol modulation method, characterized in that: The system includes a microcontroller and an infrared transmitting module. The microcontroller is equipped with a PWM module and a DMA module. The microcontroller configures the carrier period and duty cycle of the infrared protocol. The microcontroller encodes the infrared protocol data into an electrical pulse sequence configuration word corresponding to the PWM module. The DMA module sends the electrical pulse sequence configuration word to the I / O port corresponding to the PWM module. The I / O port corresponding to the PWM module drives the infrared transmitting module to emit a specific infrared protocol. The steps for encoding the infrared protocol data into the corresponding electrical pulse sequence configuration word of the PWM module are as follows: (1) Configure the carrier period and duty cycle of PWM according to the infrared protocol; (2) The number of effective pulse repetitions is obtained based on the unit effective pulse time and carrier period of the infrared protocol; (3) According to the way the infrared protocol expresses logic "1" and logic "0", logic "1" or logic "0" is composed of several effective carrier pulses and several empty carrier pulses. Among them, a single effective carrier pulse is composed of several pulse waves with the duty cycle described in step (1), and the number of several single effective carrier pulses is the same as the number of repetitions of the effective pulse in step (2). A single empty carrier pulse is composed of several pulse waves with a duty cycle of 0. Thus, the electrical pulse sequence configuration word of logic "1" or logic "0" is {......, effective carrier pulse duty cycle,......, empty carrier pulse duty cycle,......}.

2. A remote control terminal, characterized in that: It includes a microcontroller and an infrared emitting module, and executes the flexible infrared protocol modulation method described in claim 1 during infrared protocol modulation.