Modesty
December 20, 2023, 1:53pm
1
Hi
My PCB has 3 button that goes LOW when switched on and this button is pulled up by a 100k resistor. They are connected to GPIO 4, 34, 35
I also need the code (ie. 3x if sentences) to distinguish which gpio that has woken up ESP, each button runs different code.
Due to the pullup this command can't be used (I have tested this):
esp_sleep_enable_ext0_wakeup
esp_sleep_enable_ext1_wakeup
I can also not use:
esp_sleep_enable_ext0_wakeup(GPIO_NUM_4, 0); //1 = High, 0 = Low
esp_sleep_enable_ext0_wakeup(GPIO_NUM_34, 0); //1 = High, 0 = Low
esp_sleep_enable_ext0_wakeup(GPIO_NUM_35, 0); //1 = High, 0 = Low
When compiling and testing only GPIO35 is sensing the button
I have tried this also, no success:
attachInterrupt(digitalPinToInterrupt(4), alarmWakeUp, FALLING);
Is there another way around this issue?
pretty sure that's the one you want..
esp32 Sleep modes
dig into the doc some..
if RTC peripherals are powered down, internal pullup and pulldown resistors will be disabled if we don’t use the HOLD feature
maybe there's a way..
good luck.. ~q
Modesty
December 20, 2023, 2:58pm
3
Hi
thanks for reaching out
I have tried
esp_sleep_enable_ext1_wakeup
Only 2 options
ESP_EXT1_WAKEUP_ANY_HIGH
ESP_EXT1_WAKEUP_ALL_LOW
THIS IS PART OF MY PROBLEM:
I have fixed pullups, and when button pressed it goes LOW, not HIGH
And if LOW then ALL_LOW at same time, and all 3 buttons at same time is not how I need my code to work.
Can this options be a possibility?
The RTC IO module is enabled in this mode, so internal pullup or pulldown resistors can also be used. They need to be configured by the application using rtc_gpio_pullup_en()
and rtc_gpio_pulldown_en()
functions before calling esp_deep_sleep_start()
.
was thinking you were using internal pull up, but yeah i think you're correct and quite strange, seems to only have 2 modes as you describe, i guess switching to pull down is not an option??
the issue with ext0 is it only works on one pin, the last one you set, try setting in different order to verify this..
sorry ~q
maybe something here, deep sleep examples..
what's that gpio_wakeup??
~q
system
Closed
June 17, 2024, 3:24pm
6
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.