ESP32 - LAN8720 ethernet begin() and TFT_eSPI begin() order important #1411
Unanswered
bongoo1
asked this question in
Q&A - General
Replies: 2 comments
-
I suspect this is down to two libraries trying to use the same SPI port. Putting:
in the setup file may fix this. |
Beta Was this translation helpful? Give feedback.
0 replies
-
As far as I can tell the LAN8720 does not use SPI and thus the above suggestion is probably not going to work. Since you find initialising TFT_eSPI first works fine then I would stick with that solution. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i use the TFT_eSPI together with ethnernet (LAN8720 using RMII and MDIO) on an ESP32.
depending on the sequence i use to start ethernet and TFT_eSPI, this may either work or the ethnernet initialization seems to be killed by starting TFT_eSPI.
the LAN8720 is connected to the predefined RMII pins and uses pins 12=mdc, 23=mdio
while i defined for the TFT: 4=rst, 5=dc, 16=cs, 18=mosi, 33=sclk
i assume that i can set TFT miso to -1 as this one is not connected as there seems to be no need to read from the TFT.
the TFT is ILI9488 based.
if the startup sequence looks like that:
tft.begin();
WiFi.onEvent(WiFiEvent);
ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE);
server.begin(23);
both, the TFT and ethernet seem to work fine.
but if i start the TFT after ethernet:
WiFi.onEvent(WiFiEvent);
ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE);
server.begin(23);
tft.begin();
starting the TFT seems to kill the startup process of the ethernet as i just get a connection info from ethernet, but then ethernet seems to be dead as it does not request for DHCP and is not accessible anymore.
so to me, this looks like starting TFT_eSPI has impact to the MDIO connection of the LAN8720 in any way.
am i doing something wrong or is there a bug somewhere responsible for this misbehaviour?
Beta Was this translation helpful? Give feedback.
All reactions