i2c.deinit() and machine.deepsleep() on L01
-
While typical deep-sleep current of L01 is around 5uA, if machine.deepsleep() is called after i2c.init() followed by i2c.deinit(), the deep-sleep current is much higher - more that 30uA.
I found a workaround - to set SDA and SCL pins to Pin.IN before calling machine.deepsleep().
I guess this Pin re-initialization (or something similar) should be done within i2c.deinit()?
-
@danielm
Good find.I suspect it's because the pullups aren't being disabled by I2C.deinit() - a more serious problem in itself.
Can you open a new issue at https://github.com/pycom/pycom-micropython-sigfox/issues and refer to this thread please so it gets tracked properly ? If you prefer I can open it for you.
Thanks
-
@jmarcelino @danielm Setting the pins to input (high impedance) is a good low power state. If the pin set to output mode, it depends on the connected device how much current is drawn.
-
@jmarcelino
I created new issue on GitHub:
https://github.com/pycom/pycom-micropython-sigfox/issues/87 -
@robert-hh
That's true and would be good to work out some "best practices" guide for the real deep sleep mode (not the deepsleep shield stuff).In any case I feel the internal pull-ups should be turned off after I2C.deinit() and they are not at the moment, the pins remain pulled up which may cause confusion - and perhaps higher current draw.
-
Guys, thanks for the valuable input. We will create the "best practices for deepsleep" section in the docs and also improve the behaviour of the deinit() methods.
Cheers,
Daniel
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