Ir Remote Control User Guide; Introduction To Infrared Transmission; Transmitting; Receiving - Espressif ESP8266 Technical Reference

Hide thumbs Also See for ESP8266:
Table of Contents

Advertisement

!

13. IR Remote Control User Guide

13.1. Introduction to Infrared Transmission

Users can request the sample codes of infrared transmission by sending an e-mail to
feedback@espressif.com.
This document introduces how to implement transmitting or receiving remote control codes
using the 32-bit NEC IR transmission protocol as an example.

13.1.1. Transmitting

Users can use the following methods to transmit carrier wave:
BCK of I2S
38KHz carrier frequency generated by WS pin
Carrier wave generated by any GPIO via sigma-delta function. However, the duty ratio
of carrier wave generated by sigma-delta is around 20%, thus MTMS pin (GPIO14) is
suggested, for this pin can generate standard square wave at a carrier frequency of
38KHz and a duty ratio of 50% exactly.
In the sample codes, data transmission queue is generated via the DSR TIMER interface of
system FRC2, while a state machine driving the transmission of infrared data is also
generated.
Considering that the timing precision of transmitting NEC infrared code should reach a level
of µs, when initiating IR TX, system_timer_reinit should be invoked to improve the timing
precision of FRC2. In user_config.h, enable the definition of USE_US_TIMER, then interface
function os_timer_arm_us can be invoked to implement precise timing at the level of µs.

13.1.2. Receiving

The receiving of remote control codes is implemented via edge-triggered interrupt. When
one system is substracted from one another, the result is the duration time of the wave.
This can be processed by software state machine ir_intr_handler.
⚠ Notice:
Receiving of infrared remote control codes is implemented via GPIO interrupt. However, the system
can only register only one IO interrupt handler program at the same time. If other IOs also need
interrupts, please handle these interrupts in the same processing program by determine the source of
interrupt and deal with them accordingly.
In non-OS version of SDK, functions with ICACHE_FLASH_ATTR properties, including print function
os_printf defined in IROM section of the Flash, should NOT be invoked in the whole process of
interrupt handling process such as GPIO, UART, FRC, etc.
Espressif
77 86
!
/!
13. IR Remote Control User Guide
2016.05

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP8266 and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF