Wake up PyBoard

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.
Post Reply
Robert
Posts: 2
Joined: Tue Jan 16, 2018 4:50 pm

Wake up PyBoard

Post by Robert » Fri Aug 24, 2018 12:32 pm

Hi,

Is there another way to wake up PyBoard in stop or standby mode?

import pyb
rtc = pyb.RTC()
rtc.wakeup(1000) # wakeup every 1000 ms (1 second)
while True:
do_some_processing()
pyb.stop()

Thank you

shaoziyang
Posts: 363
Joined: Sun Apr 17, 2016 1:55 pm

Re: Wake up PyBoard

Post by shaoziyang » Sat Aug 25, 2018 4:41 am

In standby mode, the only way to wake pyboard is reset. In stop mode, you may use RTC or pin level irq to wake it.

Code: Select all

def pin1_irq(t):
	#do something
	return

pin1 = Pin(Pin('B0'), Pin.IN)
pin1.irq(handler=pin1_irq, trigger=Pin.IRQ_FALLING)

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

Re: Wake up PyBoard

Post by pythoncoder » Sat Aug 25, 2018 4:50 am

Yes. For ways to wake from standby and more information on building low power systems I suggest you look at this repo. Standby has the characteristic that program state is lost: it behaves similarly to a soft reset. This limits its application areas.

Waking from stop is much more versatile, because program state can be retained while stopped. My fork of uasyncio here provides a module which enables any asynchronous application to stop for a period and resume where it left off. There is a demo lpdemo.py which waits for a button press with low power consumption, retaining program state.
Peter Hinch
Index to my micropython libraries.

Post Reply