-
Doing a CTRL-D (SOFT_RESET) then going to deepsleep, when taking I needed to do a EN or my own power_on reset circuit then it would However, after running the full script below 20-30 times I then removed There is something happening that I do not understand. As far as I Pin33 drives a NPN transistor which can pull the EN line low. Test script: import umachine
import utime
from umachine import Pin, deepsleep
import esp32
wake1 = Pin(35, Pin.IN) # DS3231 wake
wake2 = Pin(26, Pin.IN, Pin.PULL_DOWN) # wake on rxDone
esp32.wake_on_ext1([wake1, wake2], level = esp32.WAKEUP_ANY_HIGH)
#poweron_reset = Pin(33, Pin.OUT)
#poweron_reset.off()
#if umachine.reset_cause() == umachine.SOFT_RESET:
# print('waiting 5 seconds so that I can do a CTRL-C')
# utime.sleep(5)
# print('do a poweron_reset')
# utime.sleep_ms(10)
# poweron_reset.on()
# print('going to deepsleep')
# utime.sleep_ms(10)
# deepsleep()
print('waiting 5 seconds before going to deepsleep')
utime.sleep(5)
print('going to deepsleep')
utime.sleep_ms(10)
deepsleep() |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
About this sequence of statements: poweron_reset.on()
print('going to deepsleep')
utime.sleep_ms(10)
deepsleep() Assuming you have the base of the NPN transistor at Pin 33 (I hope with a resistor), the emitter at GND and the collector at EN, the operation seems questionable. As soon as poweron_reset.on() is executed and Pin 33 is set to high, EN goes low and Pin 33 is going low immediately as well, resp is switched to input mode, switching the transistor off again. So the EN low pulse is very short and I do not know if the ESP32 is fully reset. If you see the output of the print statement, it's not. |
Beta Was this translation helpful? Give feedback.
-
@robert-hh if umachine.reset_cause() != umachine.DEEPSLEEP_RESET:
print('waiting 2 seconds so that I can do a CTRL-C')
utime.sleep(2)
umachine.reset() I think to do a proper external poweron_reset circuit would require a one-shot that pin33 could trigger. That could then hold the EN pin low for as long as it takes to do a proper board reset. |
Beta Was this translation helpful? Give feedback.
About this sequence of statements:
Assuming you have the base of the NPN transistor at Pin 33 (I hope with a resistor), the emitter at GND and the collector at EN, the operation seems questionable. As soon as poweron_reset.on() is executed and Pin 33 is set to high, EN goes low and Pin 33 is going low immediately as well, resp is switched to input mode, switching the transistor off again. So the EN low pulse is very short and I do not know if the ESP32 is fully reset. If you see the output of the print statement, it's not.