cancel
Showing results for 
Search instead for 
Did you mean: 

ETH: anybody used KSZ8863RLL?

LCE
Principal

Heyho,

until now I only used STM32 with the LAN8742, in a few weeks I'll get my 2nd custom board, but this time with the "dual" PHY KSZ8863RLL.

It's connected via RMII, for setup MDIO (and optionally I2C for the registers not accessible via MDIO).

Are there any known issues or "pitfalls" with this PHY?

Thanks in advance,
LCE

PS: interesting that there is no "ETH" label... :D

22 REPLIES 22

@LCE , @JR5 is referencing the hardware design guide from Microchip (DS00003048A).

@JR5, you'll notice if you look below the table of the image you shared, you aren't using the internal RMII feedback of the KSZ as suggested by @LCE in their suggestion:

a) use internal RMII clock


elidonner_0-1726589432736.png

@LCE must be using mode 4 or 5:

elidonner_1-1726589563179.png

---------------------

@LCE thanks for following up with this thread on your results and learnings. It's crazy that two other people are currently discussing this because I am just starting designing my own board. I am deciding between which mode to use for my board. I'm also trying to match that to the options shared in the STM32's datasheet (I am using STM32F407VG). The datasheet shares a couple options:

elidonner_0-1726606054962.png

I was thinking of going with "mode 5" for the KSZ, because this is what is suggested in the KSZ's hardware design guide. For providing the clock for the STM and the KSZ, I see three potential good options:

  1. Provide a crystal resonator like shown in Figure 99. Then supply the KSZ with 25Mhz from the master clock out of the STM (there is then a few options for which source of this master clock out, i.e. PLL, HSI, HSE, I'd use the HSE)
  2. Use a 25MHz external oscillator. Feed this to the STM with the HSE set up in BYPASS. Directly use the 25Mhz external oscillator to drive the KSZ. (custom edited image of datasheet):
    elidonner_2-1726608416959.png
  3. Like option B, use 25Mhz external oscillator to feed the STM, however, like option A, use the master clock out to feed the KSZ. (another custom edited image of datasheet):elidonner_1-1726608150904.png

There are other options, like going with "mode 4" and using an external 50Mhz source directly. I'm thinking of not doing this based on the suggestion in the KSZ hardware design guide, which says:

elidonner_3-1726608509305.png

 

@LCE I'd be curious to hear what you've perhaps done, or if you have an opinion on options a-c from what you have tested.

Looking around more, I think I'll move ahead with what is shown in Figure 99 (so option a from my previous post) of the ST datasheet. I'm pretty confused by Figure 98. because how I understand the STM32F4 is it doesn't have an option for an external 50Mhz Oscillator, but I could be misunderstanding how bypass mode works (maybe it needs 2x the clock?). EDIT: If you switch the HSE clock mode to Bypass in STMCubeMX, it then allows you to have the input frequency anywhere from 1-50MHz (which explains figure 98). I think I'm narrowing down on option b) or c), since both of these use an external clock source (don't have to mess with resonator desgn).

Looking online, I found this nice guide from Andy's Workshop that explains one of the main purposes of the Main Clock Output is to share the 25Mhz clock with an ethernet PHY, so this brings me to option c)

Still would love any input from you, @LCE, if you don't mind sharing any more lessons learned.

LCE
Principal

The main lessons learned:

1) as always, try to keep some ("strap") options open, e.g. at some pins place options for pull-up and pull-down resistors - if can afford it space-wise, better one too many (I had to fiddle the pull-down onto the board at P2LED1 to enable I2C)

2) make sure you have the option to use not only the MDIO, but also the I2C or SPI interface

3) do NOT feed REFCLKI from its own REFCLKO, but use the internal clock -> you must use I2C / SPI to set register 198d / bit 3

Again: with external feed the complete RMII was whacky with only 33R between REFCLKI / REFCLKO, it worked with 0R, but I don't want to rely on that, come on, only 33R and such a big impact? No thanks...

So I am using "mode 5", 25 MHz dedicated crystal for the KSZ at X1/2, RMII_REF_CLK output to STM32.