Skip to main content

Microcontroller Ethernet PHY: How to Connect an MCU's MAC to an External PHY

·Published ·9 min read

Many microcontrollers with an Ethernet controller contain only the MAC, so the board needs an external Ethernet PHY to drive the cable. Connecting one comes down to five decisions: the data interface (RMII for most 10/100 designs, MII if that is all the MAC offers, RGMII for gigabit); the clock, either a 25 MHz crystal at the PHY or a 50 MHz RMII reference shared with the MAC; the MDIO/MDC bus and the PHY address set by strap pins; a reset sequence that lets the straps latch and the clock settle; and a LAN transformer and RJ45 jack on the cable side. VOOHU is an authorized distributor for JLSemi Ethernet PHY and switch ICs, and supplies the LAN transformers and RJ45 jacks that go with them.

JL1101BR-NI
Ethernet ICs · Ethernet PHYJL1101BR-NISingle Port 10/100M Industrial Grade RMII QFN24
JL1101 series100M1RMII1.8V2.5V
JL2101C-NI
Ethernet ICs · Ethernet PHYJL2101C-NISingle Port 1000M VCC:3.3V/2.5V/1.8V Industrial Grade RGMII-COP
JL2101 series1G1RGMII1.8V2.5V
WHS16037TG
Transformers · LAN TransformersWHS16037TGSingle Port SMD 10/100Base-TX PIN16 non-PoE LAN Transformer
10/100 Base-TXSMDSingle Port161.27mm1500
WHSG24701TG
Transformers · LAN TransformersWHSG24701TGSingle Port SMD Gigabit Base-T PIN24 non-PoE LAN Transformer
SMDSingle Port241.27mm1500non-PoE

Does a microcontroller with an Ethernet MAC still need a PHY?

Yes, unless the MCU datasheet says the PHY is integrated. The MAC works in the digital domain: it builds and checks frames and hands them over a parallel interface. The PHY turns that data into the line signals on the twisted pairs, runs auto-negotiation with the link partner and reports link status back. Whether your MCU is an STM32, an NXP i.MX RT or another part, look for "integrated PHY" or a 10/100BASE-TX port in its datasheet; if you only find MII, RMII or RGMII pins, plan for an external PHY. What the PHY does is covered in what an Ethernet PHY chip is, and how it works inside in the Ethernet PHY chip white paper. This article stays between your MAC and the PHY.

MII, RMII or RGMII: which interface does your MCU need?

Use the interface your MAC offers at the speed you need. On an MCU the choice is usually made by the pin budget:

Your MCU's MACInterfaceMAC-to-PHY signalsClockJLSemi PHY from VOOHU
10/100 MAC, pins are tightRMII7, or 8 if the MAC uses RX_ER; plus MDC and MDIOOne 50 MHz reference clock shared by MAC and PHYJL1101BR-NI: RMII; 100BASE-TX, 10BASE-T and 100BASE-FX; 24-pin QFN, 4 mm × 4 mm
10/100 MAC that offers MII onlyMII16 data and control signals; plus MDC and MDIOTX_CLK and RX_CLK from the PHYJL1111B-NI: listed with MII (the JL11x1 product brief also lists RMII mode); 32-pin QFN
Gigabit MACRGMIISee the interface comparisonPHY runs from a 25 MHz crystal or oscillatorJL2101C-NI: RGMII; 1000BASE-T, 100BASE-TX, 10BASE-T; 40-pin QFN; RGMII signalling selectable at 3.3, 2.5 or 1.8 V

Signal counts for MII and RMII are as given in Texas Instruments' RMII application note SNLA076A; other documents count slightly differently, depending on which optional signals they include. A MAC and a PHY must use the same interface, so check which modes your MCU's Ethernet block supports before you pick the PHY. Timing, RGMII clock delay and SGMII are covered in MII vs RMII vs RGMII vs SGMII.

To start from the RMII listing, open the Ethernet PHY selector filtered to RMII, or clear the filter to compare all JLSemi PHYs by speed, port count, package and temperature grade.

One more check before the schematic: the I/O voltage. The JL1101BR brief lists a 3.3 V, 2.5 V or 1.8 V VDDIO supply for the MAC interface, and the JL2101(D)C brief lists 3.3, 2.5 or 1.8 V RGMII signalling. Set it to the voltage of the MCU's Ethernet pins, not to whatever rail is nearest.

Who drives the 50 MHz RMII reference clock?

In RMII, transmit and receive are both timed by one reference clock, REF_CLK, and the MAC and the PHY must both receive it. TI's SNLA076A, describing the RMII requirement, gives it as 50 MHz ±50 ppm with a duty cycle between 35% and 65%, sourced by the MAC or by an external source. On an MCU board you have three ways to provide it:

  1. 1.The PHY makes it. A 25 MHz crystal sits at the PHY, and the PHY outputs 50 MHz to the MCU's RMII reference-clock input. The JL1101BR brief lists both "Supports 25-MHz External Crystal or OSC" and "Provides 50-MHz Clock Source for MAC". This needs the fewest parts. The catch is that the MAC has no clock until the PHY is powered and running, so check in the PHY datasheet whether the 50 MHz output keeps running while the PHY is held in reset.
  2. 2.One 50 MHz oscillator drives both. The JL1101BR brief also lists "Supports 50-MHz External OSC Clock Input". Route the oscillator to the PHY and to the MCU pin with short traces. The clock no longer depends on the PHY's state, at the cost of one more oscillator.
  3. 3.The MCU makes it. Use this only if the MCU reference manual says a clock output can serve as the RMII reference and meets the same ±50 ppm requirement. If the manual does not say so, use option 1 or 2.

Whichever option you choose, the PHY has to know whether it is the clock source or a clock receiver, and the MCU's Ethernet block has to be set to RMII with the reference clock on the right pin. The JLSemi product briefs do not show how the PHY's clock mode is selected; ask our FAE team to check that setting against the full JLSemi datasheet before layout.

If the board links but drops or corrupts frames, the reference clock is the first thing to measure: probe it at the MCU pin, not at the source, and check frequency and duty cycle against the 50 MHz ±50 ppm, 35% to 65% figures above.

MII and RGMII are simpler on this point. In MII the PHY supplies TX_CLK and RX_CLK to the MAC, 25 MHz at 100 Mb/s and 2.5 MHz at 10 Mb/s, derived from its own 25 MHz reference, as TI's DP83848 datasheet describes for the IEEE 802.3 MII. The JL2101(D)C runs from a 25 MHz crystal or oscillator and has a selectable 25 MHz or 125 MHz clock output; whether your MCU needs that output depends on its reference manual.

How do MDIO, MDC and the PHY address work?

MDIO and MDC are the management bus that IEEE 802.3 Clause 22 defines alongside the MII. The MAC drives MDC as the clock; MDIO is a bidirectional data line. Each management frame carries a 5-bit PHY address and a 5-bit register address, so one bus can reach up to 32 PHYs with 32 registers each. In practice that gives you three design rules:

  • Pull MDIO up. The pull-up holds the line high when nobody drives it. Take the value from the PHY datasheet; one TI PHY datasheet, for example, asks for 1.5 kΩ.
  • Keep MDC inside both limits. If your MAC derives MDC from its bus clock through a divider, set the divider so MDC stays below the maximum in the MCU reference manual and in the PHY datasheet.
  • Know the registers you will read first. Register 0 is basic control, register 1 basic status (link, auto-negotiation complete), and registers 2 and 3 hold the PHY identifier. Reading 2 and 3 is the quickest proof that the MCU can talk to the PHY.

Because MDIO idles high through the pull-up, a read from an address where no PHY answers comes back as all ones, 0xFFFF. That is the single most useful symptom in bring-up, and the checklist further down starts from it.

The PHY address itself is usually set by strap pins that the PHY reads when it comes out of reset. Strap pins often share a package pin with another function: in one TI 10/100 PHY datasheet, the five PHY address bits sit on the COL and RXD pins and are latched at hardware reset. That has a direct consequence on an MCU board, because those RXD pins connect straight to the MCU. If the MCU drives or pulls those pins while the PHY leaves reset, the PHY can latch an address or mode you did not intend.

What to do: check in the MCU datasheet what state its Ethernet pins are in during and just after reset; place the strap resistors the PHY datasheet specifies; and avoid address 0 unless the PHY datasheet says it is an ordinary address, since some PHYs give it a special meaning (the TI part above isolates its MII at address 0). In firmware, scan addresses 0 to 31 and read register 2 at each: the address that does not return 0xFFFF is your PHY. The JLSemi product briefs do not list strap pins, so ask our FAE team for the strap table of the JLSemi part you choose.

What reset and power-up sequence does the PHY need?

The JL1101BR and the JL2101(D)C both run from a single 3.3 V supply: the JL1101BR generates its 1.2 V core supply internally, and the JL2101C has an integrated switching regulator (the JL2101DC a linear one). That keeps the power tree simple, so most of the work is in reset.

Connect the PHY's reset pin to an MCU GPIO rather than only to an RC network, so firmware can hold the PHY in reset and reset it again later. Then follow the order below. The wait times come from the PHY datasheet and differ a lot between parts: one TI 10/100 PHY datasheet, for example, asks for 167 ms after power-up (84 ms in RMII mode) but only 3 µs after a reset pulse before the first MDIO access. For a JLSemi PHY, ask our FAE team for the figures in the full JLSemi datasheet.

  1. 1.Hold the PHY in reset while the 3.3 V supply and the reference clock start.
  2. 2.Release reset once both are stable; the straps latch now, so the pins they share must be at their intended levels.
  3. 3.Wait the PHY datasheet's post-reset time, then start the MCU's Ethernet MAC, especially if its reference clock comes from the PHY.
  4. 4.Scan MDIO for the PHY address and read the identifier in registers 2 and 3.
  5. 5.Start or confirm auto-negotiation, read the link, speed and duplex from the PHY, and set the MAC to the same speed and duplex.

If the board does not come up, work through the symptoms in this order:

SymptomCheck first
PHY identifier reads 0xFFFF at every addressPHY still in reset or unpowered; MDIO pull-up missing; MDC too fast for the PHY; MDC and MDIO swapped
Identifier reads, but only at an unexpected addressStrap pins latched while the MCU was driving them; strap resistor values
Identifier reads, no linkCable side: transformer wiring, center taps, RJ45 pinout
Link is up, frames are lost or the MAC never finishes initialisingReference clock present at the MCU pin, frequency and duty cycle; MAC set to the same interface (RMII or MII) as the PHY; MAC speed and duplex taken from the PHY status
RGMII: 100 Mb/s works, 1000 Mb/s does notRGMII clock delay, added exactly once; see the interface comparison

What goes between the PHY and the RJ45 jack?

Everything after the PHY's MDI pins is the same whichever MCU you use: a LAN transformer and an RJ45 jack, or a MagJack (RJ45 jack with integrated magnetics). Two PHY-specific points matter here. First, termination: the JL2101(D)C brief says its MDI integrates the termination resistors, so do not add external ones unless the JLSemi datasheet calls for them. Second, the transformer's chip-side center taps are connected according to the PHY's driver type, explained in voltage-mode vs current-mode PHY. Step-by-step wiring is in how to connect a LAN transformer to a PHY and PHY wiring design notes.

For the two PHYs in the table, these single-port VOOHU LAN transformers share the same −40 to +85 °C operating range:

PHYVOOHU LAN transformerFrom the VOOHU datasheet
JL1101BR-NI (10/100, RMII)WHS16037TG: single-port 10/100BASE-TX, 16-pin SMDOCL 350 µH min at 100 kHz, 0.1 V with 8 mA DC bias; isolation hipot 1500 VAC, 1 mA, 60 s; operating temperature −40 to +85 °C
JL2101C-NI (gigabit, RGMII)WHSG24701TG: single-port 100/1000BASE-T, 24-pin SMDOCL 350 µH min at 100 kHz, 0.1 V with 8 mA DC bias; isolation hipot 1500 VAC, 1 mA, 60 s; operating temperature −40 to +85 °C

The transformer datasheets do not name a PHY, so send your PHY choice with the schematic and our FAE team will check the center-tap connection against it. If you would rather save board space with a jack that has the magnetics inside, start from the RJ45 selector filtered to integrated magnetics.

SolutionEthernetInterface + magneticsView solution →

FAQ

Is MDIO required for a PHY?

Not to get a link, but in practice yes for an MCU design. The PHY can auto-negotiate with the link partner without any register access, but the MCU's MAC must then run at the speed and duplex the PHY negotiated, and reading the PHY status over MDIO is how the firmware finds out. Without MDIO you have to fix speed and duplex at both the PHY straps and the MAC, and you cannot read link status or the PHY identifier.

Should I use a crystal or an oscillator for an Ethernet PHY?

For a JL1101BR on RMII, either works at 25 MHz: its product brief lists a 25 MHz external crystal or oscillator, with the PHY then supplying 50 MHz to the MAC. If you want one 50 MHz clock to feed both the PHY and the MCU, that has to be an oscillator; the brief lists a 50 MHz external oscillator input, not a 50 MHz crystal. For other PHYs, follow the clock options in their datasheet.

Why does the PHY ID read back as 0xFFFF?

Because no PHY answered at that address, so the MDIO pull-up returned all ones. Check, in this order, that the PHY is powered and out of reset, that its reference clock or crystal is running, that MDIO has its pull-up and MDC is within the PHY's limit, and that you are reading the address the straps actually set; scanning addresses 0 to 31 settles the last point.

Can one MCU MAC connect to more than one PHY?

Over MDIO, yes: one management bus can address up to 32 PHYs. The data interface is different: MII, RMII and RGMII each connect one MAC to one PHY. If one MCU MAC needs several Ethernet ports, put an Ethernet switch IC between the MAC and the ports.

Get your MCU-to-PHY design checked

Send your MCU, the MAC interface you plan to use, the clock scheme and your schematic through our sample and support form. Our FAE team can suggest a JLSemi PHY with a matching interface and the LAN transformer or MagJack to go with it, and help check the clock source, the strap pins and the center-tap connection. Samples are available for evaluation, and selected parts are free of charge. Our FAE team will be glad to confirm the options for your project. VOOHU supplies RJ45 and SFP connectors, LAN and PoE transformers and common mode chokes from Suzhou, China, to more than 1,500 customers.

Sources

  • IEEE 802.3, Clause 22 (Media Independent Interface and MDIO/MDC management interface). Described here from the TI and Microchip documents below; the standard text itself was not consulted for this article.
  • RMII Specification, Rev. 1.2, RMII Consortium. Reference-clock requirements as quoted in TI SNLA076A.
  • Texas Instruments, AN-1405 "DP83848 Single 10/100 Mb/s Ethernet Transceiver Reduced Media Independent Interface (RMII) Mode", SNLA076A, revised April 2013.
  • Texas Instruments, DP83848C/I/VYB/YB datasheet, SNLS266E, revised March 2015.
  • Microchip, KSZ8081RND Issue Triage Guide, appendix "PHY Low Level Management Techniques".
SAMPLES & SUPPORT

Need a quote, samples or selection support?

Part number JL1101BR-NI is filled in for you. Add the quantity and lead time and submit. Our FAE team will be glad to confirm the options for your project.

Before you order: samples, MOQ, lead time and import duties in our ordering guide →

REQUEST TYPE

Choose a Request Type and Fill in the Fields

You need samples, pricing, or lead time for catalog parts

Contact Details

Have attachments? Send datasheets, BOMs, or drawings to voohu@voohuele.com with your name and company, and our engineers will handle them together with this request.
  1. You see a confirmation right after submitting, and the request goes to our engineering queue

  2. Pricing and lead time within 1 business day; items without stock data are marked "To be confirmed"

  3. If information is missing, we list what we need first instead of closing the request

ThorneFAE Engineer, VOOHU ElectronicArticles: Tech Blog and Selection Guides
RELATED

Related articles

More on Ethernet PHY.

SUBSCRIBE

Subscribe to VOOHU technical articles

Get new articles in your inbox. Unsubscribe at any time.

By subscribing you agree to our Privacy Policy