5 ms·
The PHY does have a clock built in. They're clocking their writes themselves so that the clock is synchronized with the microcontroller state. For example, he
by jrockway 5y ago
The PHY does have a clock built in. They're clocking their writes themselves so that the clock is synchronized with the microcontroller state. For example, here's the code to send a bit to the PHY:
https://github.com/maximeborges/pico-rmii-ethernet/blob/main/src/rmii_ethernet.c#L103 https://github.com/maximeborges/pico-rmii-ethernet/blob/main...
(It sets the clock pin to 0, sleeps for a microsecond, puts the data bit on the data pin and sets the clock to 1, then sleeps for a microsecond.)
- monocasa 5y agoThat's pulsing the clock of the mdio (so config i2c) not the pio of the main data over rmii. Main tx data loop that depends on the 50mhz clock generated by the rp2040 is here. https://github.com/maximeborges/pico-rmii-ethernet/blob/main/src/rmii_ethernet_phy_tx.pio https://github.com/maximeborges/pico-rmii-ethernet/blob/main...
- jrockway 5y agoThat makes more sense. I avoided doing the math to determine that a 2 microsecond cycle time is not 50MHz (it's 500kHz), and in doing so, linked to the wrong thing :)