ESP32 + LAN8720 Connexion

haythemjls
Posts: 27
Joined: Mon Apr 06, 2020 1:32 pm

ESP32 + LAN8720 Connexion

Postby haythemjls » Tue Nov 09, 2021 11:24 am

Hello,
I'm working on a project based on ethernet communication via ESP32 + LAN8720 module. I tried to follow two hardware configuration:

-Configuration 1 : (using external clock 50 MHz)

#include <ETH.h>
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_IN //(4k7 pullup)
// Pin# of the enable signal for the external crystal oscillator
#define ETH_POWER_PIN 17 // (phy_power 4k7 pulldown and extra wire to enable pin)
// Type of the Ethernet PHY (LAN8720 or TLK110)
#define ETH_TYPE ETH_PHY_LAN8720
// I²C-address of Ethernet PHY (0 or 1 for LAN8720, 31 for TLK110)
#define ETH_ADDR 0
// Pin# of the I²C clock signal for the Ethernet PHY
#define ETH_MDC_PIN 23
// Pin# of the I²C IO signal for the Ethernet PHY
#define ETH_MDIO_PIN 18



-Configuration 2 : (using internal clock 50 MHz from GPIO17 or GPIO16 or GPIO0)

#include <ETH.h>
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
// Pin# of the enable signal for the external crystal oscillator (-1 to disable for internal APLL source)
#define ETH_POWER_PIN -1
// Type of the Ethernet PHY (LAN8720 or TLK110)
#define ETH_TYPE ETH_PHY_LAN8720
// I²C-address of Ethernet PHY (0 or 1 for LAN8720, 31 for TLK110)
#define ETH_ADDR 0
// Pin# of the I²C clock signal for the Ethernet PHY
#define ETH_MDC_PIN 23
// Pin# of the I²C IO signal for the Ethernet PHY
#define ETH_MDIO_PIN 18


Despit these tow configuration, I failed to make the communication succeed and always I get this message :
E (1024) emac: Timed out waiting for PHY register 0x2 to have value 0x0007(mask 0xffff). Current value 0xffff
E (2024) emac: Timed out waiting for PHY register 0x3 to have value 0xc0f0(mask 0xfff0). Current value 0xffff
E (2024) emac: Initialise PHY device Timeout


Any help please.

Who is online

Users browsing this forum: Google Adsense [Bot] and 150 guests