I'm new to ESP32-IDF.
I wrote a DHT11 driver using GPIO interrupt for edge timing measurement. ANYEDGE interrupt occurs every 25us, 54us, or 70us, and esp_timer_get_time is used in interrupt to time data.
After 80 ISR done, Interrupt is disable, and my code starts to process the timing data in a FreeRTOS task handler.
This parts works well in expectation.
HOWEVER, after I turning on WIFI, i cannot get 80 interrupts anymore (maybe even none of it).
I tried to assign CPU 1 to driver task with xTaskCreatePinnedToCore, but no luck.
any suggestion to debug? any best practice to use ESP32-IDF?
gpio interrupt fail after wifi enable
Re: gpio interrupt fail after wifi enable
Are you also registering GPIO interrupt on CPU1, or on CPU0? If you are enabling the interrupt from CPU0, then interrupt timing may be affected by Wi-Fi interrupt.
Aside from that, you may get much better results if you use RMT peripheral instead of GPIO. RMT can record pulse durations into memory, and trigger an interrupt only after the end of the pulse train. See for example https://github.com/bertmelis/esp32DHT.
Aside from that, you may get much better results if you use RMT peripheral instead of GPIO. RMT can record pulse durations into memory, and trigger an interrupt only after the end of the pulse train. See for example https://github.com/bertmelis/esp32DHT.
-
- Posts: 3
- Joined: Sun Mar 03, 2019 10:32 am
Re: gpio interrupt fail after wifi enable
Thx, referring to your suggested RMT audrino driver example, I port it to ESP-IDF with some modificaiton. It works fine now.
Who is online
Users browsing this forum: No registered users and 159 guests