1

I'm planning to build a custom board with STM32F407 chip for a system where I also need Ethernet connectivity.

I'm planning to connect this board to a LAN8720 with breakout board from Smart Electronics to have Ethernet connectivity (two independent boards connected via PHY interface).

Smart Electronics LAN8720 Ethernet Module

But I'm a bit in doubt regarding which Oscillator to couple with STM32F407. I read that for RMII we need a 25MHz oscillator to achieve the 50MHz required for RMII circuit. But I also notice that breakout board already its own 50MHz crystal oscillator.

I also notice that some of these boards do not include this extra crystal oscillator, not the case with the board I have.

In this case I still need the use a 25MHz crystal oscillator with STM32F407 or can I use the "standard" 16MHz crystal that also comes with a lot of available boards (DevEBox, DiyMoore, etc).

Thanks in advance!

Cheers, Leandro

  • If you need to gate the STM clock to some external circuitry you can use the MCO pin :) it will be detailed in the reference manual. I don't think it will be wise to use the external circuits clock as your HSE input, it's to far away etc. – Sorenp Jun 17 '21 at 07:28
  • Not sure if I understand, but I mean to use the Oscillator with Ethernet board itself just for the Ethernet comunication – Leandro Loureiro Jun 17 '21 at 14:57

1 Answers1

2

STM32 has a complex clock system that allows to generate specific clock speed for the peripherals. It means many different oscillator can work, but it has to be able to generate the correct final frequency.

You should start by looking at the STM32 stack. You can create a project with the STM32CubeMX software and configure the ethernet module.

STM32CubeMX has a visual representation of the clock and peripherals, so you can use that to get the final correct frequency and then you can see what oscillator frequency you can use as an input.

Damien
  • 7,827
  • 1
  • 12
  • 29
  • My idea is to use the external 50MHz oscillator present in LAN8720 board. I see there is a an ETH_REF_CLOCK (PA1) pin where I connect RETCLK from the board, I assume is connected to the oscillator. Do I need to do something in code generated by CubeMX to enable this pattern? I don't see any configuration related to this in CubeMX. – Leandro Loureiro Jun 18 '21 at 00:30
  • STM32 can only take crystal as input clock, not a clock source as far as I've seen, you could drive an interrupt pin with the 50MHZ but it will most likely starve the CPU. – Damien Jun 18 '21 at 04:19
  • So why then the LAN8720 board includes its own 50MHz crystal? I guess also DP83848 boards also include 50MHz crystal. – Leandro Loureiro Jun 18 '21 at 13:00