Run extint_wakeup.py on Nicla Vision

I tried waking the Nicla Vision from sleep by GPIO input.
The sample used is below.

Example - Arduino Boards - Nicla Vision - Low Power - extint_wakeup.py

I modify the source pin to “PG12” and ran it, but it didn’t start even if I set pin 1 of J1 on the board to GND.

From what I’ve researched, when I go to sleep, the PMCI (MC34PF1550A) turns off.
Then, the TXB0108 that converts the level of the PG12 pin of the CPU is turned off.
As a result, it seems that the level conversion does not work and the 1 pin signal of J1 is not transmitted to the CPU.

Is there anyone who could run this sample?
If so, please tell me how to improve.

Thank you.

Hi, machine.sleep() doesn’t turn off the 3.3V rail. Just verified that.

# ExtInt Wake-Up from Stop Mode Example
# This example demonstrates using external interrupts to wake up from low-power mode.

import time, pyb, machine
from pyb import Pin, ExtInt

def callback(line):
    pass

led = pyb.LED(3)
pin = Pin("PG12", Pin.IN, Pin.PULL_UP)
ext = ExtInt(pin, ExtInt.IRQ_FALLING, Pin.PULL_UP, callback)

# Enter Stop Mode. Note the IDE will disconnect.
machine.sleep()

while (True):
    led.on()
    time.sleep_ms(100)
    led.off()
    time.sleep_ms(100)

This example works for me? When I pull the pin low the camera wakes back up. The pin name is wrong though. That needs to be fixed.

Hello kwagyeman,

Thank you for your prompt reply.

I was able to confirm with the code you gave me.
I was able to confirm the 3.3V output during sleep from the 7 pin (VDDIO_EXT) of J2 of Nicla Vision.

Thank you.

There was a problem with my circuit, so I will post the information here.
The circuit was as follows, but I found that a resistance value of 10Kohm did not work well to make the TXB0108 be recognized as Hi.
The current increases when the button is pressed, but I found that 1Kohm works normally.

VDDIO_EXT
     |
 10Kohm
     |--------> PG12
 SWITCH
     |
  GND