Ethernet polarity - Page 1
Forum section: electronics / general

author: Harvs
author_rank: Super Contributor
timestamp: January 30, 2017, 02:25:10 am
content: I'm laying out a PCB with ARJ-169 combo Ethernet/USB jacks with integrated magnetics and a KSZ8795CLXIC 10/100 Ethernet switch/phy.Following the pinouts of these devices, with them on the same layer the RX/TX line up in order however the polarity is reversed in the pairs. (i.e. to route them would need to use vias to reverse the pins or do loops around the back side of the pins to swap the polarity.)Obviously either way of routing these is undesirable, however the KSZ8795 has a read only bit in a status register for each port "Polrvs" that describes if the polarity is reversed. However I'm guessing this is just a diagnostics tool as no where is it mentioned as a feature to be able to handle polarity reversal.So I'm guessing polarity does matter and I'm stuck with the non-ideal routing?

author: Scrts
author_rank: Frequent Contributor
timestamp: January 30, 2017, 01:46:07 pm
content: I had the same issue with KSZ9021 and decided not to take the risk - used 0ohm resistors to jump over. Never tested if it works reversed.

author: Jeroen3
author_rank: Super Contributor
timestamp: January 30, 2017, 02:06:07 pm
content: I've used one pair of via's to swap layer. No issues.If it were, it would not have used a trough hole pin.

author: AndyC_772
author_rank: Super Contributor
timestamp: January 30, 2017, 02:16:51 pm
content: Modern PHYs automatically sense and correct for reversed polarity, so it shouldn't be a problem in practice.However: there is a 'correct' polarity that devices should follow. The ability of a PHY to deal with reversal is there to cope with incorrectly wired cables, not necessarily to make laying the PCB out any easier.It may well be that the pin-out of the device suits some isolation transformers better than others.

author: Scrts
author_rank: Frequent Contributor
timestamp: January 30, 2017, 04:05:54 pm
content: I'd also offer to check development board layout.

author: nctnico
author_rank: Super Contributor
timestamp: January 30, 2017, 05:22:07 pm
content: Doesn't the phy need external components? That is usually the place where I get the signals in the right order for the transformer/RJ45 connector.

author: Harvs
author_rank: Super Contributor
timestamp: January 30, 2017, 11:00:13 pm
content: Quote from: nctnico on January 30, 2017, 05:22:07 pmNope, connects straight to the magnetics.

author: Harvs
author_rank: Super Contributor
timestamp: January 30, 2017, 11:03:10 pm
content: Quote from: Scrts on January 30, 2017, 04:05:54 pmThey use an external transformer and the pin ordering and polarity lines up with a normal RJ45. So it seems the combo jack that we've pick just has an odd polarity order.Doesn't matter much anyway, it's only 10/100 and I just looped the diff pair to the back side of the pins.

author: nctnico
author_rank: Super Contributor
timestamp: January 31, 2017, 01:28:04 am
content: Quote from: Harvs on January 30, 2017, 11:00:13 pmOK that is easy then. I'd still add some TVS diodes and add series dampening resistors or beads in the signals especially if this is to be mass produced and needs to pass EMC testing without a major board respin.

author: DBecker
author_rank: Frequent Contributor
timestamp: January 31, 2017, 02:45:26 am
content: Quote from: AndyC_772 on January 30, 2017, 02:16:51 pmAre you thinking of auto-crossover, rather than polarity correction?Polarity correction has been around for 10baseT for almost as long as it has existed.

author: Scrts
author_rank: Frequent Contributor
timestamp: January 31, 2017, 02:22:12 pm
content: Quote from: DBecker on January 31, 2017, 02:45:26 amSo in general it means that you can mix pairs and pins between pairs anyhow you like?

author: AndyC_772
author_rank: Super Contributor
timestamp: January 31, 2017, 02:31:09 pm
content: You can swap the two conductors that make up each pair, and unless auto-MDIX is turned off for some reason, you can usually exchange the Tx and Rx pairs.I'm fairly sure Gbit Ethernet allows the order of all four pairs to be switched around, though I've not tested this.You can't swap individual conductors between pairs; the right pairs of wires must be twisted together. A pair must remain a pair.

author: Scrts
author_rank: Frequent Contributor
timestamp: January 31, 2017, 04:27:13 pm
content: The issue I had was the for example DATA0- was easy to route to DATA0+ in the connector and the same situation for the complementary pair wire: DATA0+ to DATA0- on the connector side. So swapped pair wires. I've used 0ohm resistors to make a jump over a wire and connect + to + and - to -, however I was interested if it could have been left as-is. In general, the received bits would be inverted.

author: DBecker
author_rank: Frequent Contributor
timestamp: January 31, 2017, 07:14:34 pm
content: A transceiver is a quite complicated device. At 100baseT and above they need to do a bunch of signal processing for echo cancellation and other line problems. Some transceivers even have TDR reporting to help track down a broken cable. It's trivial in comparison to selectively swap/invert the signal.The typical way it works is that after three inverted synchronization bits/symbols in a row, the polarity correction bit is toggled. Most Ethernet drivers don't bother even checking for this error. "There is a problem. It was corrected automatically. You should swap the wires, but you'll probably break something else. On second thought, don't do anything. Sorry I mentioned it."

author: ajb
author_rank: Super Contributor
timestamp: January 31, 2017, 07:36:27 pm
content: I ran into the same confusion as the OP recently with another KSZ8 series PHY, which also mentions the polarity bit once in the register map and no where else. Since the polarity correction can only happen on the RX side, reversing the TX pair (or either pair when relying on auto-MDIX) assumes that the other device will be able to handle the reversed polarity. Is that a generally safe assumption to make these days?I would guess it must be since in the case of auto-MDIX the two pairs are interchangeable.

author: Scrts
author_rank: Frequent Contributor
timestamp: February 01, 2017, 01:43:19 pm
content: We had issues when the customers used some crappy devices which couldn't work without swap pair cable... Anything could happen.

author: DBecker
author_rank: Frequent Contributor
timestamp: February 10, 2017, 06:25:34 am
content: YouQuote from: Scrts on February 01, 2017, 01:43:19 pmYou are confusing the need for cross-over cables with reversing the wires in a single pair.Telephone installers paid no attention to the polarity of wires in a pair, because telephones worked with either polarity (Princess phones excepted). They paid careful attention to which pairs went where, because nobody likes someone else getting their calls. Since network wiring was usually installed by telecom guys, twisted pair Ethernet supported polarity inversion from the beginning. But until transceivers were sophisticated enough to do internal routing, it was fundamentally important that the Tx pair went to the receiver on each end, thus the need for cross-over cables if you weren't talking to a repeater which did the 'cross-over' internally.

author: Scrts
author_rank: Frequent Contributor
timestamp: February 10, 2017, 12:59:15 pm
content: Quote from: DBecker on February 10, 2017, 06:25:34 amI am not confusing there. I am just saying that you never know what customer will connect on the other end of your device...

author: ajb
author_rank: Super Contributor
timestamp: February 10, 2017, 01:44:35 pm
content: Quote from: DBecker on February 10, 2017, 06:25:34 amSo, basically, polarity correction is such a rudimentary feature it's not even worth calling out in a datasheet, and some of us are just really late to the party. Good to know.