2
\$\begingroup\$

I need to make a converter to go from RS422 full duplex to my Arduino. I have found lots of different chips which I think can do this, but am slightly confused by the terminology. The RS422 device is a laser distance sensor (Micro-Epsilon optoNCDT 1302). It has RX+, RX-, TX+, TX-. So I have two lines for input and two lines for output.

I could use two RS485 line drivers to achieve the full duplex comms which I need. There are a lot of chips to do that.

But then on my Arduino (clone: chipkit max32) would I need to use two UART channels? And then alternate which one I am sending each byte on?

The device uses 4 byte instructions. So if I wanted to send an instruction would I send Serial1(firstByte) then Serial2(secondByte), Serial1(thirdByte), Serial2(fourthByte)?

And then receive data the same way? I feel like I am missing something and can do this on one UART channel but am not sure how.

\$\endgroup\$
  • \$\begingroup\$ Also the IC's use the terms RO, DI, A, B, Y, Z etc etc. How do these line up? \$\endgroup\$ – user1902893 Feb 13 '14 at 0:30
  • \$\begingroup\$ Do you want to connect just one distance sensor to one Arduino, or there will be more than one such distance sensor? \$\endgroup\$ – Nick Alexeev Feb 13 '14 at 0:51
  • \$\begingroup\$ There is only one distance sensor. There are other sensors with the arduino but they do not use RS422. So the RS422 side of things would be single node. \$\endgroup\$ – user1902893 Feb 13 '14 at 0:59
  • \$\begingroup\$ You don't need the 2nd UART channel. You need only one. \$\endgroup\$ – Nick Alexeev Feb 13 '14 at 1:08
  • \$\begingroup\$ More importantly, you need to read-up in earnest on RS-422. It will become clear why there are two TX lines and two RX lines. A decent place to start reading is a datasheet for one of the RS-422 transceivers and associated application notes. \$\endgroup\$ – Nick Alexeev Feb 13 '14 at 1:08
2
\$\begingroup\$

In normal serial communications links, you actually need two wires - one is the signal and one is the ground. The ground stays at zero volts and the signal wire swings between 2 voltages that represent data bits 0 and 1 respectively (in RS232, the signal swings between +25 volt and -25 volts).

Using voltage to signal is not great for long wires going though noisy environments because the wires act like antennas and the voltage difference can get lost in the noise.

RS422 uses current direction rather than voltage to transmit bits. Current going one way is a 1, reversed the other way is a 0. This is much more resistant to noise.

The RX+ and RX- are the two wires that that current for received data. You can imaging sending data down this wire using a battery as a transmitter. Connect the battery one way to send a 1, or flip it the other way to send a 0. Two wires, but they carry one bit of data. You can connect this one bit of data to a single serial input (using the the correct drivers to turn the current direction on thew wires in a voltage to show the pin).

Same goes for the TX+ and TX- wires. They carry a single bit. The driver will take a single bit of data represented as a voltage on your sereial send pin, and convert it to a current flowing one way or the other on the two TX wires.

ADVICE: Unless you are making lots of these, don't mess around with driver chips (unless you want to!). You can cheaply get prepackaged current loop dongles that have screw terminals and are very easy to use. They use the same chips you are looking at, but do all save you the hassles of figuring it all out. If you get one that uses TTL level signals, you can connect it directly to your Ardunio and treat it as just a regular serial connection. Here is an example of one (I've never used this one but looks as good as any other)...

http://www.amazon.com/INBOARD-RS422-DRIVER-ET-MINI-SHIPPING/dp/B00EXUGRUK/ref=sr_1_1?ie=UTF8&qid=1392255264&sr=8-1&keywords=ttl+rs422

\$\endgroup\$
  • \$\begingroup\$ Ah ok, thanks! Well for now it is just one prototype, but in the future it will be made into part of a production so using the chips will be necessary. Thank you, again! \$\endgroup\$ – user1902893 Feb 13 '14 at 1:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.