Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    i2c.deinit() and machine.deepsleep() on L01

    Scheduled Pinned Locked Moved Issues & Bugs
    deep sleepi2c
    6 Posts 4 Posters 1.8k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      danielm
      last edited by

      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()?

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jmarcelino @danielm
        last edited by

        @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

        robert-hhR 1 Reply Last reply Reply Quote 0
        • robert-hhR Offline
          robert-hh @jmarcelino
          last edited by

          @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.

          J 1 Reply Last reply Reply Quote 0
          • D Offline
            danielm
            last edited by

            @jmarcelino
            I created new issue on GitHub:
            https://github.com/pycom/pycom-micropython-sigfox/issues/87

            1 Reply Last reply Reply Quote 0
            • J Offline
              jmarcelino @robert-hh
              last edited by

              @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.

              1 Reply Last reply Reply Quote 0
              • D Offline
                daniel
                last edited by

                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

                1 Reply Last reply Reply Quote 0

                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
                • 1 / 1
                • First post
                  Last post

                Pycom on Twitter

                Pycom