Hello. I am connecting two Arduino's, interfaced through a BlueRobotics Fathom-S system, for an underwater ROV project. Rusty from BlueRobotics has said to use "regular serial protocol" to communicate between the two Arduino's since the Fathom-S board basically just encodes the signals to Rs-422, transmits it over the tether, then decodes it back to whatever it was before; as far as anyone knows this means that you can program the Arduino's as if they were directly connected.
The catch is that you have to use the Tx/Rx pins because I2C doesn't appear to work what with the requirement for SDA and SDL. I figure with the conversion to Rs-422 in the middle the clock signal is getting messed up and ruins everything.
My question is: what serial commands should I be looking to use to get the two Arduino's passing information back and forth to each other through the Tx/Rx pins? So far I can only get an Arduino to open a serial port to the serial monitor in the IDE... how can I open a port to another Arduino? Would it be best to treat it as Rs-422 protocol for ease?
There is no "RS-422 protocol", it's just an electrical standard, and I2C will never work over 422 because the SDA signal is bidirectional and open-collector. There is an I2C buffer chip (P82B96TD) that splits the Tx and Rx parts of SDA so if you need to use I2C in this manner I would look at that.
If your Arduino can talk to a PC it can also talk to another Arduino, just connect Tx -> Rx and Rx -> Tx (via the 422 gadget).
You may find the examples in Serial Input Basics useful. I suggest you use the technique in the 3rd example.
It may be worth using SoftwareSerial to create an extra serial port on each of the Arduinos and use that for communicating between them (via the 422 gadget) as you will then have the HardwareSerial free for debug messages to the Serial Monitor.
If you unplug the fathom from the tx, and rx pin you should be able to program the arduino now. Once the arduino is programmed so long as you have the correct wiring you should be able to use the normal serial commands for communication.
You can use the Serial monitor and have arduino to arduino communication at the same time.
Graynomad:
There is no "RS-422 protocol", it's just an electrical standard, and I2C will never work over 422 because the SDA signal is bidirectional and open-collector. If your Arduino can talk to a PC it can also talk to another Arduino, just connect Tx -> Rx and Rx -> Tx (via the 422 gadget).
That's a greatly appreciated clarification! We've been labouring over the thought that Rs-422 is a serial protocol... good to know that it isn't. One of my colleagues and I troubleshot the I2C problem and dropped that, so thanks for that clarification as well.
Theoretically could I communicate between the topside and rovside Arduino's using normal serial communication, but also run the ROV side as a master for I2C between various sensor slaves? I'm not sure if that would cause trouble with other serial protocol.
Robin2:
You may find the examples in Serial Input Basics useful. I suggest you use the technique in the 3rd example.
It may be worth using SoftwareSerial to create an extra serial port on each of the Arduinos and use that for communicating between them (via the 422 gadget) as you will then have the HardwareSerial free for debug messages to the Serial Monitor.
...R
We started experimenting with the SoftwareSerial yesterday as well, thanks for the input about keeping HardwareSerial free for debugging. I'll pass that along.
135843:
If you unplug the fathom from the tx, and rx pin you should be able to program the arduino now. Once the arduino is programmed so long as you have the correct wiring you should be able to use the normal serial commands for communication.
You can use the Serial monitor and have arduino to arduino communication at the same time.
Should we be unplugging all of the Tx/Rx connections when uploading to the boards? I did have some trouble uploading to the MEGA yesterday and it had all of the serial pins used up.