29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

RM0008<br />

Ethernet (ETH): media access control (MAC) with DMA controller<br />

●<br />

●<br />

drives high-impedance on the MDIO line for the 2 bits of TA. The PHY device must<br />

drive a high-impedance state on the first bit of TA, a zero bit on the second one.<br />

For a write transaction, the MAC controller drives a pattern during the TA field.<br />

The PHY device must drive a high-impedance state for the 2 bits of TA.<br />

Data: the data field is 16-bit. The first bit transmitted <strong>and</strong> received must be bit 15 of the<br />

ETH_MIID register.<br />

Idle: the MDIO line is driven in high-impedance state. All three-state drivers must be<br />

disabled <strong>and</strong> the PHY’s pull-up resistor keeps the line at logic one.<br />

SMI write operation<br />

When the application sets the MII Write <strong>and</strong> Busy bits (in Ethernet MAC MII address register<br />

(ETH_MACMIIAR)), the SMI initiates a write operation into the PHY registers by transferring<br />

the PHY address, the register address in PHY, <strong>and</strong> the write data (in Ethernet MAC MII data<br />

register (ETH_MACMIIDR). The application should not change the MII Address register<br />

contents or the MII Data register while the transaction is ongoing. Write operations to the MII<br />

Address register or the MII Data Register during this period are ignored (the Busy bit is<br />

high), <strong>and</strong> the transaction is completed without any error. After the Write operation has<br />

completed, the SMI indicates this by resetting the Busy bit.<br />

Figure 286 shows the frame format for the write operation.<br />

Figure 286. MDIO timing <strong>and</strong> frame structure - Write cycle<br />

MDC<br />

MDIO 32 1's 0 1 0 1 A4 A3 A2 A1 A0 R4 R3 R2 R1 R0 D15 D14 D1 D0<br />

Preamble<br />

Start<br />

of<br />

frame<br />

OP<br />

code<br />

PHY address Register address Turn<br />

around<br />

data<br />

Data to PHY<br />

ai15626<br />

SMI read operation<br />

When the user sets the MII Busy bit in the Ethernet MAC MII address register<br />

(ETH_MACMIIAR) with the MII Write bit at 0, the SMI initiates a read operation in the PHY<br />

registers by transferring the PHY address <strong>and</strong> the register address in PHY. The application<br />

should not change the MII Address register contents or the MII Data register while the<br />

transaction is ongoing. Write operations to the MII Address register or MII Data Register<br />

during this period are ignored (the Busy bit is high) <strong>and</strong> the transaction is completed without<br />

any error. After the read operation has completed, the SMI resets the Busy bit <strong>and</strong> then<br />

updates the MII Data register with the data read from the PHY.<br />

Figure 287 shows the frame format for the read operation.<br />

Doc ID 13902 Rev 9 843/995

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!