How to set the Pin mode for machine.deepsleep?
-
@robert-hh
Changed the code tofrom machine import Pin RelayPin=Pin('P20', mode=Pin.IN)Didn't change it, well, P20 is always draining current now, not only in machine.sleep and machine.deepsleep.
-
@KenM In that case you most probably have an problem in the circuitry. Do you have the choice to connect the LED to GND instead of 3.3v. I'm suspecting a current through the ESD protection diodes, when during deepsleep the I/O circuitry is switched off. Whether that works for you final set-up, is another story.
-
@robert-hh
I can change the board to source it instead of drain it but I was hoping this could be fixed in software, my I2C pins with external pull-ups don't draw current.
As test I tried to init P20 as part of the I2C but that didn't change the behavior of P20. (same for P19) -
@KenM Cyn you tell which direction is the current flow of P20 is?
-
@robert-hh
It's sinking to ground through the external led/diode from 3.3V so there is only one direction possible. -
@KenM I made a test myself, using a 1k resistor between 3.3V and P20:
- after boot: 78µA
- When set to OUT, value=1: 5.2 µA
- when set to OUT, value = 0: 3.2 mA
- When set to IN: 0 µA
In any IN/OUT/value setting: Current during deepsleep: 0 µA.
I tested also P10. Same behavior.
So there may be some other reason. -
@robert-hh
That good news and bad news
You used this code above with the same firmware version like mine on a lopy4 on an extension board? -
@KenM I use 1.20.1r1, but a homebrew extension board, with absolute no connection to P20 or P10, unless I wire some.
-
@robert-hh
I did cut the connection of P20 to the expansion board but kept the connection of P20 to my board, and it work perfect now :)I will need to check if I lost some functionality of the expansion board.
All wasted time, because pycom refuses to give the schematic of the expansion board...
Thanks for doing some compare tests.
-
@KenM Welcome to the pin cutters club (https://forum.pycom.io/topic/1673/pysense-pinout-wake-on-pin/19) :-/
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login