Deepsleep Pin Interrupt now working on newer firmware versions
-
Hello,
I have set up a pin interrupt, but I have found that on versions newer than: pybytes 1.6.0 and pycom micropython 1.20.2.r1 the interrupt will not trigger.
I am using a Pytrack 1 and Lopy 4.
here is the code.
from pytrack import Pytrack import pycom,time pycom.heartbeat(False) pycom.rgbled(0x040400) time.sleep(2) pt = Pytrack() #go to sleep pt.setup_int_pin_wake_up(True) pt.setup_sleep(1000) pt.go_to_sleep(gps=False)
I have the sensor externally pulled down with a 10k resistor to make sure it triggers.
The sensor being used here is a SparkFun OpenPIR sensor.
Has anyone else had a similar problem? Is there a way to fix this so that it works with newer firmware?
-
So it looks like the issue has something to do with the pin being pulled high for too long. If I let the signal stay high while it is booting up, the chip will not run any code. It seems like the easiest solution to this problem is to have the interrupt trigger low side after the interrupt signal is over, or have a signal inverter between your interrupt and the pin.
-
@MichaelWojcik After doing more testing, the issue seems to be time-based. On the firmware versions that work, it seems that you need to wait at least 30 seconds before triggering the interrupt or you run into the same issue. The module spikes to 65mA at fairly consistent intervals after it fails, so it seems that the chip is somehow not initializing properly.
-
@jcaron said in Deepsleep Pin Interrupt now working on newer firmware versions:
supply?
I have tried using both to the same result.
The batteries I have are standard 3.7V 2000mAh E&J 674361P Batteries.
The power supply/battery simulator that I also have been using is a Techtronix 2281S-20-6 Precision DC Supply & Battery Simulator.
-
@MichaelWojcik how are you powering the device? A battery or an external power supply?
-
EDIT: I know that at the very least the interupt does attempt to wake the chip from deepsleep, as it starts to resume its normal power draw. However, it does not appear to run any of the code. My guess is the chip is browning out for some reason.
I have disabled LTE, Wifi, and Smart Provisioning on Boot, so I am not entirely sure what else the issue could be.
Any Ideas?