RTC GPIO Functions Not Working
Posted: Thu Dec 02, 2021 12:13 am
[Codebox=c file=Untitled.c][/Codebox]
Hardware being used is a Heltec Lora 32(V2) board under Arduino.
Started using GPIO 36 & GPIO 39 as inputs from a Reed Switch.
Was using RTC_GPIO functions. Could not get any inputs, high to low. Using external pullups.
Switched to RTC_GPIO 12 & 13 as inputs, no external pullups but using internal pullups.
Some sample RTC code:
rtc_gpio_deinit(GPIO_NUM_12);
rtc_gpio_deinit(GPIO_NUM_13);
rtc_gpio_set_direction(GPIO_NUM_12, RTC_GPIO_MODE_INPUT_ONLY);
rtc_gpio_set_direction(GPIO_NUM_13, RTC_GPIO_MODE_INPUT_ONLY);
rtc_gpio_pullup_en(GPIO_NUM_12);
rtc_gpio_pullup_en(GPIO_NUM_13);
Was not able to get input transition from Reed Switch.
Decided to switch to GPIO output and toggle GPIO 12. RTC_GPIO functions did not work trying to toggle the outputs on RTC_GPIO 12.
The following does toggles the output
I switched to pinMode() and digitalWrite().
Some code:
pinMode(GPIO_NUM_12,OUTPUT);
delay(200);
while (1) {
digitalWrite(12, HIGH); // sets the digital pin 13 on
delay(1000); // waits for a second
digitalWrite(12, LOW); // sets the digital pin 13 off
delay(1000); // waits for a second
}
The RTC_GPIO functions do not work! Am I missing something setting up to use these RTC Functions?
I need to be able to wake up from Deep Sleep using RTC_GPIO inputs.
What am I missing?
I have not tried to use the pinMode and digitalWrite in my code base to get inputs from Reed Switch. That's next.
Hardware being used is a Heltec Lora 32(V2) board under Arduino.
Started using GPIO 36 & GPIO 39 as inputs from a Reed Switch.
Was using RTC_GPIO functions. Could not get any inputs, high to low. Using external pullups.
Switched to RTC_GPIO 12 & 13 as inputs, no external pullups but using internal pullups.
Some sample RTC code:
rtc_gpio_deinit(GPIO_NUM_12);
rtc_gpio_deinit(GPIO_NUM_13);
rtc_gpio_set_direction(GPIO_NUM_12, RTC_GPIO_MODE_INPUT_ONLY);
rtc_gpio_set_direction(GPIO_NUM_13, RTC_GPIO_MODE_INPUT_ONLY);
rtc_gpio_pullup_en(GPIO_NUM_12);
rtc_gpio_pullup_en(GPIO_NUM_13);
Was not able to get input transition from Reed Switch.
Decided to switch to GPIO output and toggle GPIO 12. RTC_GPIO functions did not work trying to toggle the outputs on RTC_GPIO 12.
The following does toggles the output
I switched to pinMode() and digitalWrite().
Some code:
pinMode(GPIO_NUM_12,OUTPUT);
delay(200);
while (1) {
digitalWrite(12, HIGH); // sets the digital pin 13 on
delay(1000); // waits for a second
digitalWrite(12, LOW); // sets the digital pin 13 off
delay(1000); // waits for a second
}
The RTC_GPIO functions do not work! Am I missing something setting up to use these RTC Functions?
I need to be able to wake up from Deep Sleep using RTC_GPIO inputs.
What am I missing?
I have not tried to use the pinMode and digitalWrite in my code base to get inputs from Reed Switch. That's next.