MCU: ESP-32
My device has an input to place it in configuration mode, a momentary switch connects VCC to an IO pin, which triggers an interrupt when high. The ISR queues a task that sets a flag in NV mem and does a software reset. When it boots it checks for the flag in NV mem, if set it clears it and enters "air kiss" mode. All good.
But I can't include that IO pin as one of the pins that can wake it from a deep sleep, because the only pin I'm using like that is connected to a hall effect flow sensor, the sensor can come to rest in either logic level high or low, and I have to read it before sleeping to program the wake-up interrupt for the opposite level. As such if the device is sleeping when the user wants to configure, she must first press the reset button, wait half a second, then press the config button.
The momentary switch I'm using is DPDT, so I have an extra set of contacts to trigger a reset with the same press, but the ISR doesn't get hooked up until a split second after reset is released. I need the config pin to stay high just a tiny bit longer than the button is held.
Years ago, in a 12V analog circuit I kept a relay energized almost a second after its power was cut, by putting a 1000 uf cap and a 1K resistor in parallel with the relay coil. Is there something similar I can do for this 3.3V digital GPIO?
TIA
My device has an input to place it in configuration mode, a momentary switch connects VCC to an IO pin, which triggers an interrupt when high. The ISR queues a task that sets a flag in NV mem and does a software reset. When it boots it checks for the flag in NV mem, if set it clears it and enters "air kiss" mode. All good.
But I can't include that IO pin as one of the pins that can wake it from a deep sleep, because the only pin I'm using like that is connected to a hall effect flow sensor, the sensor can come to rest in either logic level high or low, and I have to read it before sleeping to program the wake-up interrupt for the opposite level. As such if the device is sleeping when the user wants to configure, she must first press the reset button, wait half a second, then press the config button.
The momentary switch I'm using is DPDT, so I have an extra set of contacts to trigger a reset with the same press, but the ISR doesn't get hooked up until a split second after reset is released. I need the config pin to stay high just a tiny bit longer than the button is held.
Years ago, in a 12V analog circuit I kept a relay energized almost a second after its power was cut, by putting a 1000 uf cap and a 1K resistor in parallel with the relay coil. Is there something similar I can do for this 3.3V digital GPIO?
TIA