cancel
Showing results for 
Search instead for 
Did you mean: 

Hi everyone , i'm trying to connect my STM32f429I-DISC1 to LAN (getting an IP) using ENC28J60 , but i didn't found the correct library of this module . Can anyone help me please ?

SMahf
Associate II
 
4 REPLIES 4

You'll perhaps need to search more broadly, rather than board specific.

Find examples using this on other STM32 Platforms, or find examples using the SPI connectivity and port those.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
SMahf
Associate II

I searched as you said to me and I Finded this tutorial for STM32F4 https://www.youtube.com/watch?v=9Wac0tJUMsE&t=297s&app=desktop and I'm getting 0xFF in the spiData buffer. I can't solve this problem. I don't know how to solve it.

Jack Peacock_2
Senior III

The ENC28J60 is an older ethernet MAC/PHY and has some issues when used with an STM32. Microchip has a newer ENC424J600 10/100 ethernet controller with a much better SPI interface. I used both many years ago. The older ENC28J60 is not easy to use and I would not recommend going forward with it since there is a far better alternative.

One issue is read/write clock edge for the SPI clock. Writes to the ENC28J60 are on the rising edge, but read are clocked on the falling edge. You need to reconfigure the SPI clock polarity depending on transfer direction. STM32 SPI ports only read/write on the same edge. Check the timing diagrams on the ENC28J60 to see how data is read and written. If you use the wrong edge you get invalid data, as you see with 0xFF.

Also, make sure the chip select remains on past the last bit clocked in/out. The SPI port has a flag to inform when shifting is complete. Otherwise data is lost.

Jack Peacock

SMahf
Associate II

Thank you for your explanation, So you mean if I use another module will be better than trying to solve problems and probably it will take time to solve.