1
\$\begingroup\$

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

\$\endgroup\$
2
  • \$\begingroup\$ 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. \$\endgroup\$
    – Sorenp
    Jun 17, 2021 at 7:28
  • \$\begingroup\$ Not sure if I understand, but I mean to use the Oscillator with Ethernet board itself just for the Ethernet comunication \$\endgroup\$ Jun 17, 2021 at 14:57

1 Answer 1

2
\$\begingroup\$

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.

\$\endgroup\$
3
  • \$\begingroup\$ 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. \$\endgroup\$ Jun 18, 2021 at 0:30
  • \$\begingroup\$ 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. \$\endgroup\$
    – Damien
    Jun 18, 2021 at 4:19
  • \$\begingroup\$ So why then the LAN8720 board includes its own 50MHz crystal? I guess also DP83848 boards also include 50MHz crystal. \$\endgroup\$ Jun 18, 2021 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.