Extra characters in RS-422 - Page 1
Forum section: electronics / projects

author: jmaja
author_rank: Frequent Contributor
timestamp: October 17, 2016, 08:32:21 am
content: I have a problem with extra characters appearing while the transmitter is on idle. The problem is that the device is in a remote location with no proper tools nor a person with electrical knowledge.The device is transmitting 9600 baud 8E1 and just characters. It outputs a measuring value, each 11 bytes long. Sometimes two in a row. So 13 or 26 ms "packets". In between the line in on idle (total about 60% of time). I don't know the length of the cable, but it is in 50-300 m range. There are several similar installations and this is the only one with problems.The extra characters are mostly 0xFF (so just a start bit), but there are others as well. The extra characters only appear between the packets, newer in the middle of the characters in a packet. The actual packets seem to be OK. There are a lot of these extra characters, close to full bandwidth.One set I got showed almost all of the extra characters as "?" in a black square. Would that indicate parity or overrun error? Or is it just a charter outside of 7 bit space? I don't know how they are reading it. I will ask them as well.How can I investigate this? I have made the unit transmitting, but not the other end, cabling nor configurations. What could be causing these extra characters? Of course the unit transmitting could actually be sending these, but this has not happened before (about 100 units in use 24/7).I have adviced the staff to measure the line with a multimeter (I hope they have one!). Voltage on DC, AC and current on DC and AC. This will tell something about the cable and the transmitter. An oscilloscope would tell much more, but they don't have one and don't know how to use one.

author: Richard Crowley
author_rank: Super Contributor
timestamp: October 17, 2016, 08:40:54 am
content: Could it be something as simple as an intermittent loop connection?Is it possible to swap that unit with another one to make a differential diagnosis?

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: October 17, 2016, 08:50:07 am
content: Are you disabling the transmitter (RS485 style) between packets ? You shouldn't really do that with RS485.If you are then you should be biasing the line to avoid glitches when transioning between driving and idle - as you are only seeing issues between packets I suspect this is the issue.a 1K resistor from D- to ground and one from D+ to +5V should take care of that.

author: jmaja
author_rank: Frequent Contributor
timestamp: October 17, 2016, 09:08:31 am
content: I'm using a RS-422 transceiver with separate RX and TX lines (LTC2863). There is not even a pin for disabling output and the transceiver is powered directly from the same LDO powering the microcontroller so it is driving the line all the time the microcontroller is powered. That should be reveiled from the multimeter check. At the lab I get over 3 V DC and about 50 mA DC, which show that the line is driven to idle.There is only one unit there, so it is not easy to swap it. But I have to send them a new one, if I can't find a solution. I'm asking if it is possible to connect it to a PC with a RS-422 converter, but they don't probably have one.

author: C
author_rank: Super Contributor
timestamp: October 17, 2016, 07:19:04 pm
content: What if the line to the LTC2863 was not driven between packets. If input to LTC2863 here is flapping in the wind could do this.Could your code in the microcontroller be changing the serial output pin mode between packets, to an input for example ?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 17, 2016, 09:05:33 pm
content: Is this an industrial environment? Noisy?Do you have any filtering or transient protection on the receiver?Tim

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: October 17, 2016, 11:12:19 pm
content: Suppose it could be one of the data lines open, or shorted to ground - differential links can sometimes work when one line is open.Probably the first test is and end-to-end resistance measurement with nothing driving, to check you can see the termination resistance at the far end. Also check for shorts to ground.

author: jmaja
author_rank: Frequent Contributor
timestamp: October 18, 2016, 05:34:02 am
content: It is an industrial enrinment. I don't know how noisy, haven't got any data, pictures etc. about the installation. But it did work with the previous trasmitter (not mine). They needed to do some changes while installing the current one, so the setup is not excactly the same.I have nothing to do with the receiver. The transmitter I have made has transient protection and the trasceiver chip is very tolerant.By default there are no termination resistances. They shouldn't be needed for 9600 baud and max 300 m cables. The transceiver is also slew rate limited, which helps a bit.The transceiver is connected to the UART port of the microcontroller. Should be actively driven all the time (except while booting). No configurations are changed during idle and the processor is not sleeping, just nothing is sent. A special message is sent after the boot. The device is not booting all the time.

author: SL4P
author_rank: Super Contributor
timestamp: October 18, 2016, 07:47:22 am
content: Quote from: mikeselectricstuff on October 17, 2016, 08:50:07 amAre you terminating the pairs? 110R or close-to ?

author: Kalvin
author_rank: Super Contributor
timestamp: October 18, 2016, 07:50:46 am
content: Quote from: jmaja on October 18, 2016, 05:34:02 am- Ask some photos- Ask what they changed during the installation- Is the line still in balanced mode or have the installers taken some sort of "clever" shortcut which has ruined the balanced line- The cabling needs to be twisted pair and one set of balanced signals needs to the same twisted pair.- If the balanced signals are separated to other twisted pairs or shared with other twisted pairs, the signalling is not balanced any more.- LTC2863 has two variants: LTC2863-2 is up to 250 kbits and LTC2863-1 is up to 20 mbits- Typically termination is a good practice on long lines (It is not the clock/baudrate which kills signal integrity, it is the edge slew rate)

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 18, 2016, 09:11:40 am
content: Can you share the schematic of your transmitter?Any info about the previous unit?Tim

author: jmaja
author_rank: Frequent Contributor
timestamp: October 18, 2016, 09:34:21 am
content: It's the 250 kbit slew rate limited version. I have understood that baudrate is very important factor here. E.g. according to this the reflections should easily damp out before the signal is read.http://ltxfaq.custhelp.com/app/answers/detail/a_id/1382/~/rs485-%26-rs422---when-is-termination-required%3FBut it is easy to add the resistors.There may be a problem with the twisted pairs, since they made changes in the connection and had wrong polarity at some stage. So it can be that RX/TX pairs are somehow mixed.I just can't understand how any of these could cause no faults while transmitting, but extra characters during idle.There is not much to show about the schematic. Just LTC2863-2, 100nF ceramic very close to it and two NUP2105 bus protection diodes connected between lines and ground (pin 1 to A, pin 2 to B and pin 3 to GND). RO and DI are connected directly to the microcontroller and both are powered with the same 3.3V LDO.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: October 18, 2016, 09:46:53 am
content: Quote from: jmaja on October 18, 2016, 09:34:21 amGround shift ? Stream of data changing the avarage line voltage - could also be consistent with one line open - the other floating around.One good reason to use a terminator is it will generally stop it working if one line is open.

author: jmaja
author_rank: Frequent Contributor
timestamp: October 18, 2016, 06:41:42 pm
content: Ground problems are the ones I'm suspecting as well. I found out that ground is not connected between the transmitter and the receiver. The receiver is 2 kV optoisolated and transmitter is grounded to 24 V negative pole, which is not connected to power earth. The chip allows +-25 V common mode. Both are powered from the same 24 V isolated power.They said that it worked better with the old transmitter without GND connection. It had an isolated transmitter. So I guess receiver port GND should be connected to 24 V negative in order to keeps the grounds equal.There is a dip switch in the receiver for setting pull high, pull low and termination resistors. These might be worth a try. By default there is 150 kohm pull high and pull low resistors. These can be individually changed to 1 kohm. By default there is no termination resistor. A 120 ohm resistor can be set.

author: jmaja
author_rank: Frequent Contributor
timestamp: October 21, 2016, 10:25:08 am
content: This problem is now solved and the solution was quite unexpected. They didn't need to send anything to the device so they didn't connect the device RX pair at all at the server end. But they did connect the wires at the device end. So they had 300 m long wire only connected to the other end and possibly the ends hanging close to noise sources. This made the device receiving a lot of false characters, which it echoed to its output.So the solution was just to connect the device RX pair or leave them unconnected also at the device.