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

    How to avoid enabling pull-down at boot

    Scheduled Pinned Locked Moved GPy
    5 Posts 2 Posters 22 Views 2 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.
    • B Offline
      Benjamin Graf
      last edited by

      Hello,
      Two of the pins I'm using (P11 and P20) should stay at 3.3V. They should switch to 0V only when requested by the program.

      So I added a 47k pull-up resistor on each of these pins.

      I now have the issue that on boot (after a reset) the pins are at 3.3V but then switch to 1.2V or so, which corresponds to having the internal pull-down resistors enabled. (internal pull-downs are 45k according to the ESP32 datasheet). I get the same voltage when enabling the pull-downs in the software.

      If I add Pin('P11', mode=Pin.IN, pull=Pin.PULL_UP) to boot.py, P11 stays at 1.2V for around 500ms and then goes back to 3.3V:

      * t=0 (reset):  P11=3.3V
      * t=638ms:      P11=1.25V
      * t=1.12s:      P11=3.3V
      

      I guess that micropython is enabling these pull-downs at boot, is there something I can do to avoid it ?

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

        @Benjamin-Graf P11 aka GPIO22 is UART0_RTS, P22 aka GPIO33 is XTAL32k_Output. You may not be able to change that behavior. You could try the "bigger hammer" approach: use a smaller resistor value for the pull-up, like 4.7k or 2.2k. The ESP32 can drive these easily to 0. With 4.7k you'll get ~3V as interim voltage, which is a safe digital high level.

        1 Reply Last reply Reply Quote 0
        • B Offline
          Benjamin Graf
          last edited by

          @robert-hh thanks a lot, I soldered 2.2k resistors and it works well, the pin voltage at boot goes down to 3.1V and the rest of my circuit behaves as expected.

          I tried to make sense of the "ESP32 pin list" as well as section A.4. IO_MUX of the ESP32 datasheet. They both indicate that there should be no pull-up/down resistors enabled at boot and reset. I guess that either micropython does set them or that not all the ESP32 behave as described. So it is better to test this kind of things before ordering PCBs.

          1 Reply Last reply Reply Quote 0
          • B Offline
            Benjamin Graf
            last edited by

            I digged a bit in the micropython source code, it looks like (I might be missing something) the pull-downs are enabled by micropython. I filed an issue here: https://github.com/pycom/pycom-micropython-sigfox/issues/571

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

              @Benjamin-Graf That seems to be done there. The reason is power saving, setting all pins to input mode with pull-down enabled.

              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