Author Topic: Ethernet polarity  (Read 11793 times)

0 Members and 2 Guests are viewing this topic.

Offline HarvsTopic starter

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: au
Ethernet polarity
« on: January 30, 2017, 02:25:10 am »
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?
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Ethernet polarity
« Reply #1 on: January 30, 2017, 01:46:07 pm »
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.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Ethernet polarity
« Reply #2 on: January 30, 2017, 02:06:07 pm »
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.
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4228
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Ethernet polarity
« Reply #3 on: January 30, 2017, 02:16:51 pm »
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.


Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Ethernet polarity
« Reply #4 on: January 30, 2017, 04:05:54 pm »
I'd also offer to check development board layout.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Ethernet polarity
« Reply #5 on: January 30, 2017, 05:22:07 pm »
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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline HarvsTopic starter

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: au
Re: Ethernet polarity
« Reply #6 on: January 30, 2017, 11:00:13 pm »
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.

Nope, connects straight to the magnetics.
 

Offline HarvsTopic starter

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: au
Re: Ethernet polarity
« Reply #7 on: January 30, 2017, 11:03:10 pm »
I'd also offer to check development board layout.

They 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.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Ethernet polarity
« Reply #8 on: January 31, 2017, 01:28:04 am »
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.
Nope, connects straight to the magnetics.
OK 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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline DBecker

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: us
Re: Ethernet polarity
« Reply #9 on: January 31, 2017, 02:45:26 am »
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.

Are you thinking of auto-crossover, rather than polarity correction?

Polarity correction has been around for 10baseT for almost as long as it has existed.
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Ethernet polarity
« Reply #10 on: January 31, 2017, 02:22:12 pm »
Polarity correction has been around for 10baseT for almost as long as it has existed.
So in general it means that you can mix pairs and pins between pairs anyhow you like?
 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4228
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: Ethernet polarity
« Reply #11 on: January 31, 2017, 02:31:09 pm »
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.

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Ethernet polarity
« Reply #12 on: January 31, 2017, 04:27:13 pm »
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.
 

Offline DBecker

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: us
Re: Ethernet polarity
« Reply #13 on: January 31, 2017, 07:14:34 pm »
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."



 
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2601
  • Country: us
Re: Ethernet polarity
« Reply #14 on: January 31, 2017, 07:36:27 pm »
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.
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Ethernet polarity
« Reply #15 on: February 01, 2017, 01:43:19 pm »
We had issues when the customers used some crappy devices which couldn't work without swap pair cable... Anything could happen.
 

Offline DBecker

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: us
Re: Ethernet polarity
« Reply #16 on: February 10, 2017, 06:25:34 am »
You
We had issues when the customers used some crappy devices which couldn't work without swap pair cable... Anything could happen.

You 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.

 
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Ethernet polarity
« Reply #17 on: February 10, 2017, 12:59:15 pm »
You
We had issues when the customers used some crappy devices which couldn't work without swap pair cable... Anything could happen.

You 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.

I am not confusing there. I am just saying that you never know what customer will connect on the other end of your device...
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2601
  • Country: us
Re: Ethernet polarity
« Reply #18 on: February 10, 2017, 01:44:35 pm »
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.

So, 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.   :-+
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf