I am trying the upower lib to wake up from deepsleep using the X1 external pin as described in the micropower repo.
I have scope on my external trigger signaland it looks as expected. It is high (default), then drop to low for ~ 10-15ms, then return to high. I am hoping to capture this low to high transition to wake a pyb 1.1 (firmware 1.11) every few 10-20 sec for this test. When I run the script along these lines as main.py (to make sure it runs again after the board resets)...:
Code: Select all
from upower import wakeup_X1 wkup = wakeup_X1() # code omitted wkup.enable() if not upower.usb_connected: pyb.standby()
To t.shoot my physical setup, I ran it against another small program that uses machine.lightsleep instead, in a loop, and the same physical pin set as trig-in using the IRQ methods on Pin (so no upower.py lib used this time). Everything else is the same. In this case it runs as expected.
But of course with lightsleep current is ~ 780uA... while in deepsleep it was ~ 30uA ... Any idea appreciated. I haven't tried the Tamper class yet... Thx.
[Update]: Tamper method seems to work better as it wakes up the board when the ext trigger fires. However, it gives a bunch of false triggers and awake the board when the real triggering signal is not present... There are some small amplitude drops on the trigger line which may causes that... Using Tamper with edge detection or level detection does not fix the false alarms glitch...
I use the pins of the pyboard as is... no pull up resistors since I am not using any manual switch...
Also, the code base with the lightsleep and IRQ does not generate false triggers...