Hi there,
On the RT1062, the SW2 button was quite handy as it allowed us to turn the board on and off (without requiring to plug and unplug the battery’s JST connector, which is quite difficult).
The N6 also has a “PWR” button but it seems it only wakes the board from deep sleep. Is there a hardware limitation that justifies this or will the feature be introduced? Is there a workaround in the meantime?
The N6 doesn’t have any sort of hardware logic to turn the system on and off via the button. You have to add an ext int interrupt on the button being pressed and do machine.deepsleep(). It’s just a wakeup when you are sleeping.
So, going to sleep will be software-based solution to turn off is what you have to do. How this works is up to you.
Thanks Kwabena. I tried different things but can’t get the board to recognize my PWR button press on the N6.
In the IDE built-in example extint_wakeup.py for the N6, I can see that the ExtInt “listens” to P5 (which is next to “SW2 - WKUP2” in the N6 pinout diagram - is it a coincidence?) to wake up the board from sleep. However, neither pressing the PWR button nor connecting P5 to ground do anything. Am I doing something wrong?
I also tried just catching the other user button press, SW, which works, but when setting the interrupt to the “SW” pin, I cannot wake the board. Setting a pin to SW works but not SW2.
Hi, with the latest N6 firmware, the wakeup pins are armed after you enter deep sleep. Bringing P11 low or pressing SW2 will wakeup the camera. Otherwise, these are normal GPIO pins you can just read the state of.
So, when you want to shut down, you’d just activate an EXT on SW2 or P11 and then call deep sleep.
Note that only SW2 and P11 have deep sleep wakeup abilities.
Ah so the problem was that I had to install the latest development firmware (I was already at 5.0.0 but upgrading doesn’t hurt heh?).
The extint_wakeup script works now with the P11 pin, whether I pull the pin low or press the SW2 button. However, I had to replace machine.sleep() with machine.deepsleep() and P5 with P11 in the example script.
Now I’ll try to use SW2 to put the board to deep sleep.