MDIO Protocol
MDIO (Management Data Input/Output) is the two-wire bus defined in IEEE 802.3 that an Ethernet MAC or switch uses to configure and monitor its PHYs: a clock, MDC, driven by the station manager, and a bidirectional data line, MDIO. Clause 22 addresses 32 registers per PHY; Clause 45 extends it for 10 Gbit/s and faster PHYs. The Beagle I2C/SPI protocol analyser monitors MDIO at up to 2.5 MHz in both Clause 22 and Clause 45 formats, and logic analysers with an MDIO decoder do the same alongside other signals.
How the MDIO Bus Is Wired
One station management entity (STA) drives MDC and starts every transaction. Up to 32 PHYs share the two lines, each strapped to a different address. MDIO is driven by the STA for the header and by the PHY for read data, so it has a pull-up. On a read the STA releases the line at the turnaround and the PHY drives the second turnaround bit low; on a write the STA drives 10. Unlike I2C, there is no acknowledge: a missing PHY simply leaves the line pulled high, and reads return 0xFFFF.
How an MDIO Frame Works
- Preamble: 32 clocks with MDIO high let every PHY synchronise. Some PHYs allow the preamble to be suppressed.
- Start and opcode: start 01 marks Clause 22, start 00 marks Clause 45. The opcode says read or write; in Clause 45 it can also be an address frame (00) or a read with post-increment of the address (10).
- Addresses: Clause 22 sends a 5-bit PHY address and a 5-bit register address. Clause 45 sends a 5-bit port address and a 5-bit device address (the MMD, such as PMA/PMD, PCS or auto-negotiation).
- Turnaround: two bit times for the bus to change direction on a read; the STA drives 10 on a write.
- Data: 16 bits, most significant first. In Clause 45 a register access is two frames: an address frame carrying the 16-bit register number, then a read or write frame carrying the data.
Registers You Will See Most
| Clause 22 Register | Name | Use |
|---|---|---|
| 0 | Control | Reset, loopback, speed and duplex selection, auto-negotiation enable and restart |
| 1 | Status | Link up, auto-negotiation complete, abilities |
| 2 and 3 | PHY identifier | Organisationally unique identifier and model number: the first thing to read on a new board |
| 4 and 5 | Auto-negotiation advertisement and link partner ability | What each end offered |
| 13 and 14 | MMD access control and data | Reach Clause 45 registers through Clause 22 frames |
| 16 to 31 | Vendor specific | Defined in each PHY datasheet |
Where MDIO Is Used
- Embedded Ethernet: a microcontroller or SoC MAC configuring a 10/100 or Gigabit PHY at boot and polling link status.
- Switches: a switch chip or host processor managing many PHY ports, often through Clause 45 at 10 Gbit/s and above.
- Optical modules: CFP-family and older XENPAK modules use MDIO for management (SFP, SFP+ and QSFP modules use I2C instead).
- Automotive Ethernet: 100BASE-T1 and 1000BASE-T1 PHYs set master or slave mode in a Clause 45 register, often reached through Clause 22 registers 13 and 14; cable diagnostics are usually in vendor-specific registers.
Common MDIO Faults and How to Find Them
| Symptom | Likely Cause | What to Check |
|---|---|---|
| Every read returns 0xFFFF | Wrong PHY address, PHY in reset, or no pull-up and nobody driving | Decode the PHY address field and compare with the PHY strap pins; check PHY reset timing |
| PHY identifier reads correctly, nothing else works | Driver uses Clause 45 frames on a Clause 22-only PHY, or the reverse | Look at the start code: 01 is Clause 22, 00 is Clause 45 |
| Intermittent wrong data | MDC above 2.5 MHz or MDIO rise time too slow for the pull-up and load | Measure MDC frequency and MDIO edges on an oscilloscope |
| Link never comes up | Auto-negotiation disabled or advertising nothing | Decode writes to registers 0 and 4 during driver start-up |
| Writes ignored | Turnaround or preamble not as the PHY expects | Check the preamble length and the turnaround bits in the capture |
Tools for Analysing and Driving MDIO
Watch tools listen to the bus and decode PHY address, register and data. Drive tools act as the station manager to read and write PHY registers from a PC.
Protocol Analyser
| Product | Role | Capability | Price ex VAT |
|---|---|---|---|
| Total Phase Beagle I2C/SPI (TP320121) | Watch | Non-intrusive MDIO monitor up to 2.5 MHz, Clause 22 and Clause 45, in Data Center software v2.20 or the Beagle API (later Data Center versions dropped MDIO); needs at least 3.0 V logic high on MDIO; the same unit monitors I2C and SPI | €500,95 |
Logic Analysers With MDIO Decoding
| Product | Role | Capability | Price ex VAT |
|---|---|---|---|
| Saleae Logic 8 | Watch | 8 channels, digital and analogue; MDIO decoder in the Logic 2 software | €506,95 |
| Saleae Logic Pro 8 | Watch | 8 channels at higher sample rates; same decoder, with analogue view of MDIO edges | €1.038,95 |
| Acute TravelLogic 34-Channel | Watch | Logic analyser running Acute's decoder library, which includes MDIO and MII | €1.453,95 |
Driving MDIO From a PC
| Product | Role | Capability | Price ex VAT |
|---|---|---|---|
| Promira with I2C Active Level 1 (TP600110) | Drive | Total Phase describes MDIO controller emulation by toggling two GPIO pins from the Promira software API; timing is set by software, so it suits register access, not timing tests | €150,95 plus the €1.301,95 Promira |
Need to see the Ethernet traffic itself as well as the PHY configuration? Tell us the PHY and link speed and we will recommend a set-up.
Frequently Asked Questions
Is MDIO the Same as I2C?
No. Both use a clock and a data line, but MDIO has no acknowledge, a fixed frame of preamble, addresses, turnaround and 16 data bits, and push-pull or tri-state drivers with a single pull-up. An I2C decoder cannot read it; use an MDIO decoder.
What Is the Difference Between Clause 22 and Clause 45?
Clause 22 has 32 registers per PHY and is enough for 10/100/1000 Mbit/s PHYs. Clause 45, added for 10 Gbit/s, splits each port into up to 32 devices with 65,536 registers each, using an address frame before each access. Many PHYs support both, and Clause 22 registers 13 and 14 give indirect access to Clause 45 registers.
How Fast Is MDIO?
IEEE 802.3 sets a maximum MDC rate of 2.5 MHz. Many MACs and PHYs run faster, up to about 12.5 MHz or more, but only if both ends say so in their datasheets. A full Clause 22 frame is 64 clocks, about 26 µs at 2.5 MHz.
What Is MDC/MDIO Called in Datasheets?
Some vendors call the whole interface SMI (serial management interface), with MDC and MDIO as its clock and data. Usually that is the same Clause 22 or 45 bus, but some switch datasheets also use SMI for a separate, non-standard register-access mode on the same pins, so check the frame format in the datasheet.
Why Do My Reads Return All Ones?
Nothing drove MDIO during the data phase, so the pull-up held it high. The PHY address is wrong, the PHY is still in reset, or the PHY only answers Clause 22 frames and the driver sent Clause 45 (or the reverse).
Where to Start with MDIO (Ethernet PHY Management)
More Protocols
By John Legg CEng, Director, Debug Store. Updated 12 November 2026.



