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

    Expansion Board pin numbers vs LoPy pin numbers

    Scheduled Pinned Locked Moved MicroPython
    5 Posts 3 Posters 3.0k Views 4 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.
    • J Offline
      Jakko
      last edited by

      Let me ask a naïve question, for which there is probably a very straightforward answer:

      Why is the pin numbering on the expansion board (beginning with 'G') completely different from the pin numbering on the LoPy (beginning with 'P')? The expansion board numbers also are not mentioned on the newly published Pin-Out overview.
      What am I missing?

      Thanks,

      Jakko

      1 Reply Last reply Reply Quote 3
      • X Offline
        Xykon administrators
        last edited by

        I'm assuming it was done to provide backwards compatibility for the WiPy1 expansion board.

        Christian Ehlers

        L 1 Reply Last reply Reply Quote 0
        • J Offline
          Jakko
          last edited by

          Thanks Xykon, that makes sense.

          Is it then correct that both Pin('Px', ......) and Pin('Gx', .......) with x being the pin number, will be recognized by micropython?

          X 1 Reply Last reply Reply Quote 1
          • X Offline
            Xykon administrators @Jakko
            last edited by

            @Jakko Yes

            from machine import Pin
            p_out=Pin('G23',mode=Pin.OUT)
            p_out.id()
            'P2'
            

            Christian Ehlers

            1 Reply Last reply Reply Quote 1
            • L Offline
              LoneTech @Xykon
              last edited by

              Yes, the G numbers are to match the WiPy 1 (version 2 uses ESP32 like the LoPy), and the WiPy 1 in turn got their order from the GPIO pin order on the CC3200 processor it uses. LoPy's support for the G numbering is fairly explicitly to keep the expansion board the same, as the P names are all under machine.Pin.module and the G names are under machine.Pin.exp_board. By the way, those locations hold preexisting instances of all the pins, so can be used to access the few that currently crash (like G3/P16). That's one bug I plan to chase down after source release.

              1 Reply Last reply Reply Quote 1

              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