Electronic – Framing error on Rx line in rs485 to ethernet converter

converterhardwarers485

I have a device connected to MOXA nPort 5150 via 4-wire rs-485 cable. Termination resistor inside the converter was set to 1 kΩ (another option was 150 kΩ, which didn't work at all – I got framing errors on both sides) and now I have a correct signal on transmitting lines (my device properly reacts to commands).

Unfortunately, the data that is sent back from the device to converter is corrupted. I constantly get framing errors with parts of data intact. For example I shoud get 18 bytes of data:

30 30 30 30 30 30 30 31 30 30 30 30 30 30 30 30 30 0d 00

And I get 17:

30 60 30 30 30 30 30 31 04 02 82 02 06 02 02 82 0d 00

Incorrect serial port settings obviously aren't the reason (as I can transmit data to the device correctly). It is also highly unlikely that there is something wrong with the cable (I was able to connect another converter using the same cable and it worked, it was ATC1000 rs485 to ethernet converter).

Also, when I connect Rx lines to Tx lines (in a loop) the signal is passing through without problem.

I considered adding bias resistors to receive lines. I'll try it and see what happens aanyway, but it'll take some time. Meanwhile I wanted to ask:

Is it possible that ATC1000 converter has bias resistors implemented internally, and MOXA5150 doesn't, or rather MOXA has it implemented only on transmitting lines? Or can there be another reason for this problem?

EDIT:

After adding bias resistor on receive line, signal is a little better (less framing errors), but is still corrupted.

Using shielded cable doesn't change anything.

Surprisingly, another MOXA device, UPort 1150 (which has bias resistors embedded) behaves in the exact same way (Transmision gets through without problems, receive signal is corrupted). This converter works correctly in other cases (with different devices). The third converter I have (ATC1000, not MOXA) still works correctly with my device…

Best Answer

What resistor do you refer as the termination? The 1 kOhm resistor is still way to much for RS485. If the twisted pair is your media (as it should be), resistors should be around 120 Ohms (100 to 150 Ohms) between the lines. Of course, this should be arranged only at the connection endpoints. Is it possible that your ATC1000 which is working just have those resistors, and in other case they are not present (and you 1 kOhm is not a proper termination).

You migh also want to try some 10 kOhm resistors from each line to the ground. It is not termination, but helps keeping the noise on the lines down when there is no transmission (so that receivers would not get false signal triggering UARTs).

I have also had the case of going 'too fast' into reception mode (when working in half duplex), so that my firmware would cut off part of the message. It was resolved by having receiver on all the time so that my sender would actually 'see' everything that went down the line when transmitting. If that was not the case I would have to arrange for some delay before starting receiving, and delay could be to long so I could miss the start of the message.