🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Cant Get RS485 TTL Convertor Working

    Scheduled Pinned Locked Moved Modules
    5 Posts 2 Posters 4.4k Views
    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
      jkeyser
      last edited by jkeyser

      Trying to get this working, but am unable to send/receive anything at all https://shop.m5stack.com/products/rs485-module

      Ive tried on the core (pins 17/16) and core 2 (pins 14/13).

      For testing im just running this very basic code but can only get 'None' as a response. To send data im just using YAT and a USB->RS485 convertor which I have tested using a known-working device. Any ideas of what might be wrong?

      from m5stack import *
      from m5ui import *
      from uiflow import *
      
      uart1 = machine.UART(1, tx=14, rx=13)
      uart1.init(9600, bits=8, parity=None, stop=1)
      while True:
        print(uart1.readline())
        wait_ms(500)
      
      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jkeyser @jkeyser
        last edited by

        @jkeyser if anyone comes across this in the future, at least on the core 2 the correct pins are 33/32

        G 1 Reply Last reply Reply Quote 0
        • G Offline
          gavin67890 @jkeyser
          last edited by

          Hi @jkeyser, Did you get it working on pins 32/33?

          If not, these posts might help you.
          https://forum.m5stack.com/topic/5615/m5-tough-uart-communication/12
          https://forum.m5stack.com/topic/1546/micro-bit/8

          I just wanted to clarify because I think that UART is indeed on pins 13/14.

          If you see the table in this document
          https://docs.m5stack.com/en/core/core2

          PORT. PIN Note:
          PORT-A(Red) 32/33 I2C
          PORT-B(Black) 26/36 DAC/AD
          PORT-C(Blue) 13/14 UART

          The Groove port on the side of the Core2 is I2C (A/Red), which is probably where the 32/33 comes from (you may be able to switch mode and run on 32/33, please confirm if you can). The port of the TTL to RS485 convertor is UART (C/Blue). You can pin this directly onto a naked Core2 with a Groove to Dupont cable or a base with UART (C/Blue) port. In my case, I have CatM IoT base or you might have the blue port on the M5GO2 base available, which I think is default supplied with the Core2. Best of luck.

          Atom LITE | Atom Matrix | StickC | CORE2 | Paper | ...

          J 1 Reply Last reply Reply Quote 0
          • G Offline
            gavin67890
            last edited by

            This, at approx. 5 mins in, might help with the I2C port reassigning for UART (I recalled I used it for StickC).
            https://www.youtube.com/watch?v=zSUyC-SQOEU

            Atom LITE | Atom Matrix | StickC | CORE2 | Paper | ...

            1 Reply Last reply Reply Quote 0
            • J Offline
              jkeyser @gavin67890
              last edited by

              @gavin67890 I was able to get it working with 32/33 just by assigning with

              uart1 = machine.UART(1, tx=32, rx=33)
              

              which it looks like is the same the guy did in the video

              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
              • First post
                Last post