OpenWrt Forum Archive

Topic: Lan Transformer and PHY

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

PHY is physical interface to connect a jack and talk to CPU. AFAIK, lan transformers are used for coupling and facilitate voltage level for same level ( RJ-45 connector ).

I wonder , if i have chipset with Reduced MII (RMII in PHY mode ) then why there is lan transformer still in between?

//ali

The usual hardware setup for an Ethernet interface is like this:

  • the CPU talks to a MAC using a peripheral bus

  • the MAC (Media Access Controller) is in charge of receiving/transmitting Ethernet frames, adding preambles, headers, padding, FCS, etc. in the transmit direction, and filtering based on MAC address, removing preambles, headers, padding, veryfying FCS in the receive direction

  • the MAC transfer data to/from the PHY using a the MII (Media Independent Interface) or RMII (Reduced (Media Independent Interface)

  • the PHY (PHYsical layer) interfaces to the Ethernet analog line modulation at one end and binary packet signaling at the other.

  • the analog signals from/to the PHY go through (Pi) filters

  • the analog signals from/to the filters go through Ethernet  1:1 transformers, which provides both isolation and EMI filtering to avoid noise going out to/being received by the Ethernet cable

  • you reach the RJ45 socket eventually!

So with or without RMII, you still need Ethernet ("LAN") transformers.

(Last edited by Squonk on 30 Nov 2012, 14:56)

Lovely and that was very helpful.

I assume that mcu's PHY interface ( media independent interface ) can not talk to simple jack  as far as we don't have mag-jack ( bulletin lan transformer).

So, what are the real problems to hook a cpu right to the plastic build RJ-45 connector? And what exactly is PHY IC?

//ali

No, the MII or RMII  are a MAC <=> PHY interfaces and are digital signals.

What is required by the Ethernet RJ45 connector and cable are analog signals, so you need an "Ethernet modem", which is just what the PHY chip is doing.

Sometimes (like in the Atheros AR9331 chip), the CPU, MAC and PHY are all integrated into one single chip, so the only signals in/out of the chip are all analog signals to /from the Pi filter, Ethernet transformer and RJ45 connector/cable, see the center/top area of this schematic:

http://squonk42.github.com/TL-WR703N/


As for the "MagJack" RJ45, the Ethernet transformer is built-in, so you don't need to add a separate transformer, but is is generally more expensive than having separate transformer + connector, and also provides less electrical isolation because of integration.

(Last edited by Squonk on 30 Nov 2012, 16:04)

Thank you for detailed response.

The way I see RMII/MII needs a PHY only if there is a connector ( RJ-45 ) for external devices.

http://2imgs.com/2i/t/2c4fe3c91a.jpg

Let say i have 2 routers and they are connected in in bridge/repeater configurations. Everything is working and now i want to replace the RJ-45 connection with RMII interface. Given that both routers have RMII. Is it actually doable? Atleast, it makes sense to me  smile



//ali

MII or RMII is a high-speed (25 MHz for MII, 50 MHz for RMII if I remember well) digital interface, only meant for on-board (< 2.5 or 5 cm max) connections.

To achieve a longer distance like the ones obtained for Ethernet , you need low-voltage, differential, filtered, matched-impedance analog signals, and electrical isolation against ESD, thus the PHY + Pi filter + transformers + twisted pair shielded cable...

You know, electronic engineers do not add all this stuff because it is fun: it is just required. So NO, you can't just bypass all that!

And even if you want to connect 2 MII or RMII interfaces directly over a very short distance (< 2.5 to 5 cm), you will have to cross the signals (output on input and vice-versa), designate one side as master for clock, etc., which is also not easy to do...

For an example of this Reverse MII setup (not to get confused with RMII), see schematic page 102 of DM8603 datasheet:

http://img20.imageshack.us/img20/3750/reversemii.png

(Last edited by Squonk on 1 Dec 2012, 19:19)

As far as I can i see the best option would be to have a PHY IC in between RMII chips and that should serve the purpose.  This is simple but not the elegant design. And should consider the additional cost involved.

But again, i wonder why not just let both RMIIs talk to each other directly while taking care of cross signals. The thing i have in mind is basically a switch/repeater, so it should be configured in salve mode and let the other chipset ( a connection from main router) serve as a master. The distance between both interfaces is far more less than  (2.5 to 5 cm) so what are the odds to go down this way?

//ali

See the schematic in my last post: it is for MII, you have to figure out how to do it for RMII.

Also, if you don't have both chip on the same board, you may get into transmission problems, too, and Idon't want to see the EMI caused by such a non-shielded  LV-TTL level connection: it will result in awfully high emissions!

I did look into schematic and that was helpful to draw a conclusion. In my case both are will be on same board and not to mention that i will have reduced MII ( RMII) rather bit complicated MII. So I  think its the way to go.

Any thoughts ?

//ali

If you put both chips on the same board, then it doesn't really matter if you will be using MII or RMII.

Just be careful that RMII uses a 50 MHz clock, and MII only 25 a MHz one, so it is generally easier to route MII because of lower speed singals, but you have almost 2x more wires, so it depends...

Put a good ground below and all around the signals, route the clock separately, and make the traces as short as possible, if possible matched both in length and impedance to avoid spurious transmission errors.

If you have an IBIS model of your MACs, try a simulation with actual trace impedance and dimensions to tune them as much as possible.

The discussion might have continued from here.