LoPy4 i2c under Pins P13 to P18

  • Hello,

    I'm new here with a LoPy4 received last week!.

    My project needs many GPIO's and I want to ask if it's possible to attach SDA and SCL under pins P13 and P14 (P13 to P18 appear as only input pins on datasheet).

    I have tested and didn't work so my question is: if adding pullup/pulldown resistors will work or I'll fry something? I think will not work but I want to ask for advice.

    Many thanks in advance

  • @robert-hh
    Okay, understood. Will test and update here with my findings.

    Thank you again @robert-hh for your great great support!

  • @river Just tried. You can use UART0, even if it is connected to REPL. It must be a different MP port which blocks it.

  • @river Documenation about Dupterm()
    "Duplicate the terminal (the REPL) on the passed stream-like object. The given object must at least implement the read() and write() methods."
    You can add other streams to the REPL i/o wir dupterm. dupter(None) just stops that, but UART0 is always connected to UART0.

  • Thanks, I will test this and update my post.
    I want to connect via modbus to other devices with uart1 to rs485 converter, and I want to do the same with uart0 to rs232.
    I see that is possible to disable REPL with os.dupterm(None), so I think it's possible to do plain uart communication in program or maybe I'll need something more?

  • @river Principly the UART Pins are assignable to any GPIO Pin. You have to try whether it works for UART1. UART0 is used for the REPL, and the assigenment to the port is done somewhere in the firmware. If the esp32 allows assigning of the UART Rx to P13 to P18, then changing of the firware will lead to the desired result.

  • Hello @robert-hh

    Many thanks for your response, in order to save pins it's possible to assign uart0 and uart1 RX side to these pins (input)?
    TX side will be under their original pins P1 and P3. I plan to use rs232 and rs485/CAN on these.

  • @river No, it does not work. for I2C SDA is input AND output, SCL is output only.

Log in to reply

Pycom on Twitter