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

    Interfacing RS485 board to Wipy3.0 (with expansion board) fro Modbus implementation

    Scheduled Pinned Locked Moved WiPy 2&3
    3 Posts 2 Posters 21 Views 2 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
      JSmith
      last edited by

      Hello all,

      I am wanting to use my Wipy as a modbus master to send and receive data to/from field devices. I plan on using a 3.3V SP485 breakout board (https://thepihut.com/products/rs485-board?variant=40242630721731)

      I see there is a Pycom Modbus library, but theres limited & few complete forum discussions which conclude upon the success of this library. But im hopeful it will allow me to do what im wanting.

      What im unsure of is how to interface with the board, specifically the pin labelled RSE (which I think is the RE & DE pin of the below RS3485 chip commoned together)
      cd046eee-c169-4eb2-ad55-225966b6d610-image.png

      What function does this serve? Can I just tie them to a constant high or low source since my device will always be a master? Or does the Modbus library dynamically control the state of this pin (maybe this is the Ctrl pin in the following documentation: https://github.com/pycom/pycom-modbus/tree/master/uModbus)

      Ideally I wouldnt want to loose an output pin, so if theres another way or board which would only require the Rx & Tx pins then please let me know.

      Furthermore any RS485 examples would be much appreciated!

      Thanks in advance!

      1 Reply Last reply Reply Quote 0
      • E Offline
        Elizar
        last edited by

        RS-485 is meant to be a multi master bus. In contrast to an RS-232 there are no separate transmit (TxD) and receive (RxD) wires. Therefore there are enable signals for the sending and receiving buffers to avoid data collisions.

        As one can see from the schematic symbol the control signals /RE and DE have different polarity (active low, active high) and may therefore be tied together. They may then be connected to a single cpu pin to switch the data direction (talk/listen). Your are right, this is probably the RSE signal.

        Since the modbus protocol probably requires you to transfer datagrams in both directions (request something and listen for the answer) I would recommend to tie RSE to a digital I/O pin. So three pins are needed in total.

        Besides the talk/listen switching RS-485 is much like a normal serial line.

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

          Thanks for the info Elizar

          So since as you say RS-485 physical protocol allows for multi-master networks, am I right in thinking the software protocol itself still only allows for a single master architecture?
          I believe you are right when you say about requesting and listening (I think the master poll's a device's address to respond with the required data).

          I see the Modbus library also allows for TCP as opposed to 485. Can anyone suggest how I would physically connect the Wipy3.0 to a TCP network? This is something I pretty new to!
          Thanks :)

          1 Reply Last reply Reply Quote 0

          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