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

Enabling RMT/semaphores in complex code can cause analogread to return values 2x too big #462

Closed
marcmerlin opened this issue Mar 28, 2017 · 4 comments

Comments

@marcmerlin
Copy link

As first reported here MartyMacGyver/ESP32-Digital-RGB-LED-Drivers#7
using the RMT neopixel driver causes analogread to return 4096 for 50%-100% and proper values from 0 to 50%.
Sadly if you are sampling data that needs to go in the 50 to 100% range (joystick), it's impossible to get usable data.
If i comment out just these 3 lines of code, then analogread works properly again:
//RMT.conf_ch[RMTCHANNEL].conf1.mem_rd_rst = 1;
//RMT.conf_ch[RMTCHANNEL].conf1.tx_start = 1;
//xSemaphoreTake(ws2812_sem, portMAX_DELAY);

@projectgus
Copy link
Contributor

Are you seeing this running with Arduino or on IDF?

@marcmerlin
Copy link
Author

marcmerlin commented Mar 28, 2017

arduino, in my IoTuz code.
Sadly if I take the code way down to just turning the LEDs on with the RMT code, then analogread works.
Yet, if I take all the IoTuz code, and comment out the 3 RMT lines above, then all the analogreads that weren't working right, start working right again.

@projectgus
Copy link
Contributor

Please open the issue here: https://github.com/espressif/arduino-esp32/issues/ as the ADC software implementations (along with various other subsystem parts) are different.

If you can reproduce the issue under IDF by itself then feel free to reopen here.

@marcmerlin
Copy link
Author

Ooops, sorry I was under the wrong project, moved accordingly, thanks for the note.
espressif/arduino-esp32#290

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

2 participants