cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f217VET ethernet project via MII

Noname1937
Associate III
Posted on November 25, 2017 at 20:17

Hello I am using this microcontroller for a project with ethernet. From what I've been reading everyone recommends that I use MII instead of RMII since RMII incurs in a lot of packet loss. And reading the errata I noticed that there is a problem with the PLL (MCO) because of jitter and the workaround for this problem in MII mode  is to use a 25 MHz external crystal to generate the HSE clock and output the clock signal on the MCO pin to clock the PHY.

Couldn't I simply use a separate 25MHz oscillator especifically for the PHY? Or does it have to synced with the microcontroller?? According to

https://www.reddit.com/r/AskElectronics/comments/269tvh/mii_vs_rmii_on_stm32/

 Simply using a separate oscillator instead of the MCO pin would suffice (one oscillator for the microcontroller and another for the PHY instead of connecting MCO to the PHY). Is this correct? 

What I want to do is use the internal oscillator of the microcontroller and the PHY .. something like the images attached ... where z-phy is the connections to the phy and z-stm32 the connections to the microcontroller. 

From what I've been reading this is not good, since I'd need a stable clock for the microcontroller as well ... meaning that the only modification to my schematic would be to add an oscillator for the microcontroller .. am I right?

#ethernet #lwip #stm32f2
4 REPLIES 4
Posted on November 25, 2017 at 21:54

Feeding the HSE (25 or 50 MHz) clock out the MCO is a viable approach, you could also feed the same clock to both HSE_IN and XI/REFCLK.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on November 25, 2017 at 23:34

Thank you for your response. 

So you're saying that maybe I can feed both clock inputs with the same oscillator? I read somewhere that maybe I could use the MCO pin to feed XI/REFCLK if I was using a 25MHz oscillator for the HSE

Posted on November 26, 2017 at 00:25

Yes you could feed HSE or HSE/2 out via the MCO (PA8) pin.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on November 30, 2017 at 10:43

Sorry it took me such a long time to answer. What I mean is, does this resolves the issues in the errata? Am I going to get packet loss due to clocking? Is it better to use 2 separate oscillators instead of feeding the microcontroller with 25MHz and using the MCO pin to clock the PHY?