After testing if the ESP32-C3 could wake from a rising edge GPIO, it does not seem to work. The datasheet was a bit ambiguous, but after writing the RTC_CNTL_GPIO_WAKEUP_REG for edge trigger the MCU would not wake when a signal was applied to the GPIO pin.
void RTC_DATA_ATTR wake_stub_sleep_counter(void)
{
wakeup_cause = esp_wake_stub_get_wakeup_cause();
if(wakeup_cause & 0x04)
{
// Wakeup cause GPIO
++wake_count;
intr_type = intr_type == GPIO_INTR_HIGH_LEVEL ? GPIO_INTR_LOW_LEVEL : GPIO_INTR_HIGH_LEVEL;
gpio_ll_deepsleep_wakeup_enable(&GPIO, GPIO_NUM_4, intr_type);
// Go back to sleep
esp_wake_stub_sleep(&wake_stub_sleep_counter);
}
else
{
esp_default_wake_deep_sleep();
// Return from the wake stub function to continue
// booting the firmware.
return;
}
}
0.8*1.2=0.96Wh
3.3*8.4e-3=0.0277W
0.97/0.277=34.63H (if on continuously)
34.6/(12.4e-3*2)=1395Hours (if one pulse per second on average)
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.