Deepsleep Pysense button interrupt triggered always
-
Hi
I am using putting the FiPy to deepsleep mode (with setting up interrupt for the pysense button, P14).
The board just keeps waken up without pressing the button for deepsleep interrupt.
The code:import machine import time print("Wake reason:", machine.wake_reason()) machine.pin_deepsleep_wakeup(pins = ('P14',), mode = machine.WAKEUP_ANY_HIGH, enable_pull = True) print('going to sleep') machine.deepsleep(20000)
Output:
Upload done, resetting board... ets Jun 8 2016 00:22:57 rst:0x7 (TG0WDT_SYS_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff8028,len:8 load:0x3fff8030,len:1728 load:0x4009fa00,len:0 load:0x4009fa00,len:14584 entry 0x400a059c Wake reason: (0, None) going to sleep ets Jun 8 2016 00:22:57 rst:0x5 (DEEPSLEEP_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff8028,len:8 load:0x3fff8030,len:1728 load:0x4009fa00,len:0 load:0x4009fa00,len:14584 entry 0x400a059c Wake reason: (1, [Pin('P14', mode=Pin.IN, pull=Pin.PULL_DOWN, alt=-1)]) going to sleep ets Jun 8 2016 00:22:57 rst:0x5 (DEEPSLEEP_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff8028,len:8 load:0x3fff8030,len:1728 load:0x4009fa00,len:0 load:0x4009fa00,len:14584 entry 0x400a059c Wake reason: (1, [Pin('P14', mode=Pin.IN, pull=Pin.PULL_DOWN, alt=-1)]) going to sleep ets Jun 8 2016 00:22:57 rst:0x5 (DEEPSLEEP_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff8028,len:8 load:0x3fff8030,len:1728 load:0x4009fa00,len:0 load:0x4009fa00,len:14584 entry 0x400a059c Wake reason: (1, [Pin('P14', mode=Pin.IN, pull=Pin.PULL_DOWN, alt=-1)]) going to sleep ets Jun 8 2016 00:22:57 rst:0x5 (DEEPSLEEP_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff8028,len:8 load:0x3fff8030,len:1728 load:0x4009fa00,len:0 load:0x4009fa00,len:14584 entry 0x400a059c Wake reason: (1, [Pin('P14', mode=Pin.IN, pull=Pin.PULL_DOWN, alt=-1)]) going to sleep Disconnected. Press any key to reconnect.
I tried using P10 with another program and connecting a wire from 3V3 to P10 for interrupt. That works.
Can anyone check if this problem is just for my Pysense board or is there something I am doing wrong in the code?
-
@akshayjames
I think the problem is the button on the Pysense goes low when pressed, not high, so you want to wake up on low.