I am wondering if the official ArduinoModbus library (or the RS485 library it's based on) is compatible with the Portenta Machine Control out of the box?
According to the description of the library it's meant for MKR boards with the MKR 485 shield or similar.
But the Machine Control comes with RX/TX 485 pins so it seems weird to me if Arduino does not have standard software to support this function of their product...
In this post
It looks like this is assumed(?), however I cannot find any specifics and my own attempts at establishing communication with the ArduinoModbus library have not been successful.
I've never used Portenta or the Portenta Machine Control board, so this might not be much help.
I would determine which hardware serial port is connected to the SP355E chip that handles the RS485/RS232 line driver/receiver functions.
I would determine which I/O pin controls the RS485 line driver/ line receiver function.
I would also determine which I/O pin controls the RS485/RS232 discrete control signal into the SP355E chip.
You should be able to determine the above from either the Arduino documentation or the board schematic.
Once you have those 3 pieces of information, you should be able to get the ModbusMaster library working with your setup. The only additional line of code that you would need to add in your case, is the one that drives the digital output pin to set the SP355E into RS485 mode. That should be done in your setup and the rest should work.
EDIT: Have you visited the Arduino web page:
In the Essentials under suggested libraries, there is one called Arduino Machine Control. That one has examples of how to use RS485 in half duplex mode. That should answer the above questions for you.
Hi,
Thé answer is Yes for the portenta BREAKOUT on serial1. thé problem is, the portenta Machine dors not use the RS485 thé same way, so I would say No.
Do not lose faith, this subject has been submitted to the dev team about a month ago, so we should have some news pretty soon.
Hello Didier,
Where will the answer become available once the dev team has answered?
Is this something a group of people have gotten together and asked?
/ Einar