pyb.standby() and ExtInt Line identification

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: pyb.standby() and ExtInt Line identification

Post by pythoncoder » Wed Oct 07, 2015 1:41 pm

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.
Peter Hinch
Index to my micropython libraries.

JimTal001
Posts: 176
Joined: Thu Jul 30, 2015 4:59 pm

Re: pyb.standby() and ExtInt Line identification

Post by JimTal001 » Wed Oct 07, 2015 6:59 pm

Peter,

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
connected like: Gnd ---- Push button --- Pin 'X18'

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: pyb.standby() and ExtInt Line identification

Post by pythoncoder » Thu Oct 08, 2015 5:47 am

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.

Post Reply