OK, there's some code here https://github.com/peterhinch/micropyth ... opower.git which supports waking from tamper (X18), wakeup (X1) and from rtc.wakeup(), and a demonstration program showing how to differentiate between boot and each of these sources. To the best of my knowledge these are the only ways to recover from standby().
The docs are a tad hot off the press and will get the benefit of some reviewing over the next few days so please bear with me if they are a bit ragged round the edges.
pyb.standby() and ExtInt Line identification
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: pyb.standby() and ExtInt Line identification
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: pyb.standby() and ExtInt Line identification
Peter,
Regarding the Tamper example (ttest.py), are you using a simple button as the trigger in the case below?
connected like: Gnd ---- Push button --- Pin 'X18'
Regarding the Tamper example (ttest.py), are you using a simple button as the trigger in the case below?
Code: Select all
tamper.setup(level = 0, freq = 16, samples = 2, edge = False) # A level of zero triggers
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: pyb.standby() and ExtInt Line identification
Yes: in level triggered mode pin X18 is periodically pulled up via a resistor internal to the chip. Pin X1 requires a button to 3.3V as it's pulled down.You may need new firmware (pybv10-2015-10-08-v1.4.6-49-gfd38799.dfu) as there was a bug which Damien fixed yesterday. My latest build checks for this. There is another firmware issue regarding standby periods exceeding five minutes a fix for which is in progress.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.