We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

Using GPIO11 clobbers I2C?



  • Hi all,

    I'm trying to use the PWM Expansion module along with a GPIO (11) as an output. Though as soon as I set the output mode on the GPIO, all the I2C devices vanish, disabling the PWM Expansion module.

    Nothing is connected, just the Omega2 on a Power Dock with the PWM Expansion on top. I even have a rubber spacer in between the two to avoid any shorts. I've used the PWM Expansion on its own in past projects, has worked fine.

    On bootup, everything looks fine:

    root@Omega-10D9:~# i2cdetect -y 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- 5a -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: 70 -- -- -- -- -- -- --
    

    Great! 5A is the PWM Expansion (not sure what 70 is). But then I run this little python script:

    import onionGpio
    
    gpio11 = onionGpio.OnionGpio(11)
    gpio11.setOutputDirection(0)
    

    And wham, no more I2C devices:

    root@Omega-10D9:~# i2cdetect -y 0
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    

    Any suggestions? I specifically chose GPIO11 because it's not associated with any other function.

    Thanks!



  • Dug a bit deeper and it seems GPIO11 is reserved for the reset button, etc. It's just not shown on the dock pinouts, it appears to be free i.e.

    alt text

    Reference:

    https://docs.onion.io/omega2-docs/using-gpios.html#pins-at-boot
    http://onioniot.github.io/wiki/Documentation/Hardware/Omega-Hardware.html

    So I think I'll be OK using a different GPIO, but would be nice to understand what's going on here a little more and have that shown in the dock pinouts.



  • @Leif-Bloomquist This issue is a hardware compatibility side effect.

    Omega2: During boot the boot loader sets GPIO11 to Output and High. This ~3.3V high level will be the "power suply" (instead of Omega's 2.5V)

    • for the RESET BUTTON (FW_RST) on Omega2 Expansion Dock, Power Dock, Power Dock 2 and Arduino Dock
    • for the I2C level shifter's lower voltage section on a PWM/Servo Expansion and/or an OLED Expansion

    The Expansion Header of the "original" Omega vs. Omega2
    expansion-headers.png

    I2C logic level shifters: VDD25 ie. 2.5V or 3.3V of the GPIO11 Output High is the power supply of the lower voltage section - these circuits don't work without it.
    ( GPIO20, GPIO21 are GPIO4 and GPIO5 on Ommega2 respectively)
    pwm-expansion-resized.png

    You can find lots of details about Omega2 hardware for example here:
    https://github.com/OnionIoT/Onion-Hardware



  • Thanks for the detailed explanation!

    Though it makes me wonder why GPIO11 is on the breakout header at all. It doesn't seem usable by end users.



Looks like your connection to Community was lost, please wait while we try to reconnect.