Some confusion on the Pin_out layout.



  • Hello fellows.

    I have a lopy4 which I have upgraded to the firmware version 1.20.0

    import os
    os.uname()
    (sysname='LoPy4', nodename='LoPy4', release='1.20.0.rc3', version='v1.9.4-c5b0b1d on 2018-12-17', machine='LoPy4 with ESP32', lorawan='1.0.2', sigfox='1.0.1')

    I want to implement the following example code on ATOM:

    from machine import Pin
    led = Pin('G16', mode=Pin.OUT, value=1)
    led(0)
    led(1)

    According to https://docs.pycom.io/.gitbook/assets/lopy4-pinout.pdf, the physical PIN 16 is the eighth from top to bottom on the left side (considering that the LED is on top), BUT!!! it only works when I connect PIN 18 (the forth from bottom to top).

    What could be the problem? I will try to downgrade the firmware. Any suggestions will be appreciated
    Thanks

    PS: PIN 13 on ATOM reflects on PIN 16 on Lopy4.




  • Global Moderator

    @researcher There are four different numbering schemes used for the Pins, and so it is totally confusing

    • The Pxx numbers of the modules. These can be used in the code as 'P1', 'P2', ... or Pin.module.P1, Pin.module.P2, .... These numbers are shown in the Pinout of the development modules
    • The Gxx numbers of the expansion board (and of the WiPy1 board). These can be used in the code as 'G1', 'G2', .. or Pin.exp_board.G1, Pin.exp_board.G2 .. These numbers are shown in the Pinout of the expansion board
    • The GPIO numbers of the ESP32, like GPIO1, GPIO3, ... This is useful for reference to the technical manuals of the ESP32 and should therefore be kept, but you cannot use these in your python code.
    • The physical pin number of the ESP32 package. These numbers are shown in the Pin-out of the module closest to the module picture. That is the one you picked, but this information is not useful at all, unless you make your own PCB with an ESP32 chip. So it should better not be shown in the Pin-Out of the module. Who ever is interested in that, would anyhow refer to the ESP32 vendor's documentation (which is espressif).

    When using development modules, most people use the 'Pxx' numbering, even if Pin.module.Pxx is a little bit more effective. But 'Pxx' is shorter to read and type.



  • @researcher there are different names for the pins, the pin numbering on the LoPy match P* names, not G*.

    G* names match the numbering on the expansion board, I think.



Pycom on Twitter