Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IR Remote Control interface on esp8266 #2899

Closed
unreality opened this issue Jan 25, 2017 · 9 comments
Closed

IR Remote Control interface on esp8266 #2899

unreality opened this issue Jan 25, 2017 · 9 comments

Comments

@unreality
Copy link

In the ESP8266 datasheet (https://espressif.com/sites/default/files/documentation/0a-esp8266ex_datasheet_en.pdf) it mentions an IR Remote Control Interface (section 4.8, page 16) on the MTMS (IO14) and GPIO5 (IO5) pins.

Is this an actual 38khz signal generated by hardware we can use, or is it just a software-implemented? Has anyone used this interface before?

@lrmoreno007
Copy link
Contributor

It's the documentation of ESP8266EX no ESP8266.

ESP8266EX is a development board with an ESP8266 and IR Remote integrated. http://tech.scargill.net/wp-content/uploads/2015/04/ESP8266-Development-Board.jpg

Close this issue.

Regards.

@duncan-a
Copy link

duncan-a commented Jan 25, 2017 via email

@lrmoreno007
Copy link
Contributor

lrmoreno007 commented Jan 25, 2017

Try this lib...
https://github.com/markszabo/IRremoteESP8266

You can use any PWM pin (0 to 15).

And read...
http://forum.arduino.cc/index.php?topic=224231.0

@unreality
Copy link
Author

IRremoteESP8266, and every other IR lib for ESP ive seen, just uses software bit banging/delayMicrosecond to generate a 38khz signal. That's all well and good, but I was hoping the ESP had a way in hardware to generate the signal, either via PWM or using a Timer etc.

So im wondering what functionality is referenced by the manual in that section.

@tablatronix
Copy link
Contributor

tablatronix commented Mar 14, 2017

Is is referenced in RTOS technical , but not in SDK. I am not sure if that just means there is no SDK implementation or GPIO function for MTMS

https://github.com/espressif/esp8266-rtos-sample-code/tree/master/02Peripheral/Infrared

https://espressif.com/sites/default/files/documentation/esp8266-technical_reference_en.pdf

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

#define GEN_IR_CLK_FROM_IIS 1
#define IR_GPIO_OUT_MUX PERIPHS_IO_MUX_MTMS_U
#define IR_GPIO_OUT_NUM 14 
#define IR_GPIO_OUT_FUNC FUNC_GPIO14

@tablatronix
Copy link
Contributor

Theres a sigma_delta_gen_38k , but this sdk has a sigma delta unused, not sure what the deal is with that or wnat that even means.

@tablatronix
Copy link
Contributor

The other option in rtos (according to example), was to use iis clock or dma since sdk now has i2s registers, i wonder if we can use i2s_set_rate 38k for carrier..

@hotplot
Copy link

hotplot commented Sep 20, 2017

For anybody else who finds this issue, you can generate a 38 kHz signal in hardware by configuring the MTMS pin as the I2S clock signal and setting the frequency appropriately.

I have a code example here: https://github.com/hotplot/BlastIR/blob/master/src/ir_send.cpp

@devyte
Copy link
Collaborator

devyte commented Oct 4, 2017

This type of question and discussion is best held at a community forum.
Closing due to off topic, see #3655 .

@devyte devyte closed this as completed Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants