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.

2 wiresMDC clock and MDIO data
2.5 MHzMaximum MDC rate in IEEE 802.3
32 PHYs5-bit PHY or port address
Clause 2232 registers per PHY
Clause 4532 devices per port, 65,536 registers each
Pull-upMDIO needs one, typically 1.5 kΩ to 2.2 kΩ

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.

MDIO wiring: one station manager, two PHYs, shared MDC and MDIO linesThe station management entity, usually the Ethernet MAC or a switch, drives the clock MDC. MDIO is a bidirectional data line with a pull-up resistor, shared by two PHYs at PHY addresses 1 and 2. A protocol analyser taps MDC and MDIO and only listens.Station managerMAC, switch or MCUMDC (clock)MDIO (data)PHYaddress 1PHYaddress 2Protocol analyserlistens, never drivespull-up
A station manager and two PHYs on MDC and MDIO. A protocol analyser taps both lines.

How an MDIO Frame Works

Clause 22 and Clause 45 MDIO frame fieldsClause 22 frame: 32-bit preamble of ones, start 01, opcode, 5-bit PHY address, 5-bit register address, 2-bit turnaround, 16 data bits. Clause 45 frame: the same preamble, start 00, opcode, 5-bit port address, 5-bit device address, turnaround, and 16 bits of either register address or data.Clause 22PRE32 x 1ST 01OP01 W, 10 RPHYAD5REGAD5TA2DATA16 bitsClause 45PRE32 x 1ST 00OP2 bitsPRTAD5DEVAD5TA2ADDR or DATA16 bits
Clause 22 and Clause 45 frames share the preamble, turnaround and 16-bit data field. The start code tells them apart. Clause 45 opcodes: 00 address, 01 write, 11 read, 10 read with post-increment.
  1. Preamble: 32 clocks with MDIO high let every PHY synchronise. Some PHYs allow the preamble to be suppressed.
  2. 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).
  3. 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).
  4. Turnaround: two bit times for the bus to change direction on a read; the STA drives 10 on a write.
  5. 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 RegisterNameUse
0ControlReset, loopback, speed and duplex selection, auto-negotiation enable and restart
1StatusLink up, auto-negotiation complete, abilities
2 and 3PHY identifierOrganisationally unique identifier and model number: the first thing to read on a new board
4 and 5Auto-negotiation advertisement and link partner abilityWhat each end offered
13 and 14MMD access control and dataReach Clause 45 registers through Clause 22 frames
16 to 31Vendor specificDefined 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

SymptomLikely CauseWhat to Check
Every read returns 0xFFFFWrong PHY address, PHY in reset, or no pull-up and nobody drivingDecode the PHY address field and compare with the PHY strap pins; check PHY reset timing
PHY identifier reads correctly, nothing else worksDriver uses Clause 45 frames on a Clause 22-only PHY, or the reverseLook at the start code: 01 is Clause 22, 00 is Clause 45
Intermittent wrong dataMDC above 2.5 MHz or MDIO rise time too slow for the pull-up and loadMeasure MDC frequency and MDIO edges on an oscilloscope
Link never comes upAuto-negotiation disabled or advertising nothingDecode writes to registers 0 and 4 during driver start-up
Writes ignoredTurnaround or preamble not as the PHY expectsCheck 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

ProductRoleCapabilityPrice ex VAT
Total Phase Beagle I2C/SPI (TP320121)WatchNon-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£400

Logic Analysers With MDIO Decoding

ProductRoleCapabilityPrice ex VAT
Saleae Logic 8Watch8 channels, digital and analogue; MDIO decoder in the Logic 2 software£405
Saleae Logic Pro 8Watch8 channels at higher sample rates; same decoder, with analogue view of MDIO edges£830
Acute TravelLogic 34-ChannelWatchLogic analyser running Acute's decoder library, which includes MDIO and MII£1,161.65

Driving MDIO From a PC

ProductRoleCapabilityPrice ex VAT
Promira with I2C Active Level 1 (TP600110)DriveTotal 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£120 plus the £1,040 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.