External wakeup from deep sleep on XIAO ESP32C3

@Dean_Arnold Sorry for not explaining clearly enough.

The end result was that I could get a keypad to work with the settings you had in your code, ie rows and columns swapped.

The only problem is that the middle row (GPIO 43) can’t retain the low level required to trigger a wake interrupt. The other two rows work fine.

With the code you posted above, when entering sleep mode, you are using standard GPIO routines to set the pull-up and pull-down state. This won’t work as you need to use the rtc_gpio functions.

I don’t have the same keypad as you so I can’t fully test the code but it works fine using my keypad. If I get some spare time I’ll rewire it to work the same as yours to confirm which keys work.

@Dean_Arnold - I have tested a system with the keypad I have here rewired to operate with the same keys you have on your keypad.
It works well, with a 35mA operating current (irrelevant really) and a 14uA Deep Sleep current.
As suspected the “middle row” doesn’t wake the device, only the two “outer rows” where the RTC GPIO’s are connected.

I also added a “jumper” wire (soldering) from GPIO 7 (D8) to GPIO 43 (D6) to get a full keypad. Since you are soldering the battery terminals and pin headers anyway, it should be an easy enough addition. If you don’t want to use another GPIO pin, a 10k pulldown resistor will do the trick (also tested OK).

Hi there,

here is a good Sleep and Wake video… :+1:

HTH
GL :slight_smile: PJ :v: