I'm testing ethernet with the ESP32-PICO-KIT + Waveshare LAN8720 module.
I got ethernet working as per https://sautter.com/blog/ethernet-on-es ... g-lan8720/ but I now want to use GPIO0 as clock output instead of input.
To achieve this, I removed R12 and R14 resistors on the waveshare board and jumped between R12 and R14 with one of the 33ohm resistors so that the R_RXCLK pin on the board is connected to the CLKIN pin of the chip through the 33ohm resistor.
I changed one line of the code to read "config.clock_mode = ETH_CLOCK_GPIO0_OUT".
On trying this code i get the error "emac: Timed out waiting for PHY register 0x2 to have value 0x0007(mask 0xffff). Current value 0xffff". On checking with an oscilloscope, i do not see any clock generated on the GPIO0 pin.
What am I doing wrong? Any help is appreciated.
ETH_CLOCK_GPIO0_OUT not working (No clock output)
Re: ETH_CLOCK_GPIO0_OUT not working (No clock output)
Which esp-idf version do you use?
Re: ETH_CLOCK_GPIO0_OUT not working (No clock output)
Just to be sure, I checked out release/v3.2 and switched the compiler to recommended version (5.2) but the problem is the same.
Re: ETH_CLOCK_GPIO0_OUT not working (No clock output)
Does the 50MHz clock have any relation to configuring the lan8720? Why does register setup fail when I disconnect the oscillator? I can see the clock on the scl line.
Re: ETH_CLOCK_GPIO0_OUT not working (No clock output)
Is there anyway to debug this? I would like to avoid the extra pin to enable the oscillator and the cost of the oscillator itself. Hence, I would like to use GPIO0_OUT. GPIO16 and GPIO17 are unavailable on PICO-D4.
Re: ETH_CLOCK_GPIO0_OUT not working (No clock output)
The lan8720 needs a clock to do anything, not sure why there is no output on gpio0 for you
Re: ETH_CLOCK_GPIO0_OUT not working (No clock output)
Yes. I can confirm that on the same setup the config fails when I simply disable the 50MHz clock.
I checked again with an oscilloscope with GPIO0 open (disconnected from LAN8720) and i can see that ~50MHz clock does come on GPIO0 when setup with GPIO0_OUT but I noticed that the amplitude of the clock is very small (~0.2V peak to peak) while the same from the oscillator is nearly 2V peak to peak. Could this have anything to do with it?
Re: ETH_CLOCK_GPIO0_OUT not working
Is there any way to increase the clock out amplitude as I suspect that to be the problem?
Who is online
Users browsing this forum: No registered users and 39 guests