Hello, Hoping to get some advice on establishing a connection on the RMII interface between an LPC1768 and a RTL8304 PHY. The PHY indicates it is sending data but the GMAC is not generating any interrupts.
The PHY has 2 network ports that are operating. I am able to retrieve data from the PHY on the MDIO interface, which indicates the network ports can link up and indicates the MAC is up. The PHY statistics registers also indicate it is receiving data on the ports and transmitting data to the MCU.
I am currently using the following connections, which I was able to get to work on a different MCU and this PHY.
NXP LPC1768 | | Realtek PHY | |
Pin | | RTL8304MBI | I/O |
P1_15 / ENET_REF_CLK | - | REFCLK | O |
P1_8 / ENET_CRS | - | TXEN | O |
P1_9 / ENET_RXD0 | - | TXD_0 | O |
P1_10 / ENET_RXD1 | - | TXD_1 | O |
P1_4 / ENET_TX_EN | - | CRS_DV | I |
P1_0 / ENET_TXD0 | - | RXD_0 | I |
P1_1 / ENET_TXD1 | - | RXD_1 | I |
P1_16 / ENET_MDC | - | MDC | I |
P1_17 / ENET_MDIO | - | MDIO | I/O |
I also tried the following connections, but the IAR debugger crashes as soon as the pins are initialized. So I have returned to the above connections.
NXP LPC1768 | | Realtek PHY | |
Pin | | RTL8304MBI | I/O |
P1_15 / ENET_REF_CLK | - | REFCLK | O |
P1_4 / ENET_TX_EN | - | TXEN | O |
P1_0 / ENET_TXD0 | - | TXD_0 | O |
P1_1 / ENET_TXD1 | - | TXD_1 | O |
P1_8 / ENET_CRS | - | CRS_DV | I |
P1_9 / ENET_RXD0 | - | RXD_0 | I |
P1_10 / ENET_RXD1 | - | RXD_1 | I |
P1_16 / ENET_MDC | - | MDC | I |
P1_17 / ENET_MDIO | - | MDIO | I/O |
I have initialized the pins as follows:
PINSEL_ConfigPin_17xx(1, 0, 1); // P1.0 - ENET_TXD0
PINSEL_ConfigPin_17xx(1, 1, 1); // P1.1 - ENET_TXD1
PINSEL_ConfigPin_17xx(1, 4, 1); // P1.4 - ENET_TX_EN
PINSEL_ConfigPin_17xx(1, 8, 1); // P1.8 - ENET_CRS
PINSEL_ConfigPin_17xx(1, 9, 1); // P1.9 - ENET_RXD0
PINSEL_ConfigPin_17xx(1, 10, 1); // P1.10 - ENET_RXD1
PINSEL_ConfigPin_17xx(1, 14, 1); // P1.14 - ENET_RX_ER
PINSEL_ConfigPin_17xx(1, 15, 1); // P1.15 - ENET_REF_CLK
// NXP LPC1768 MDIO pins
PINSEL_ConfigPin_17xx(1, 16, 1); // P1.16 - ENET_MDC
PINSEL_ConfigPin_17xx(1, 17, 1); // P1.17 - ENET_MDIO
Looking at the RMII interface with a scope I found the TX_EN, TXD1 and TXD0 are steady around 2V and the CRS, RXD0, RXD1 lines are at 0V. And the REFCLK is at 50MHz.
For a test I removed the TX_EN, TXD0/1, CRS, RXD0/1 connections and with a scope on the PHY pins I see a repeating pattern about every 10ms which appears to auto negotiation pulses, TX_EN is high during a stream of pulses appearing on TXD0/1.
It appears to me that the PHY is working and attempting to send data to the MCU, but when the MCU is connected the signals are snubbed. So I also tried changing the pins from mode 0 (default, on-chip pull-up resistor enabled) to mode 2 (neither pull-up nor pull-down resistor enabled). But still no luck.
Any thoughts or ideas greatly appreciated.
Thanks
9-16-2022 - Additional info added
Below are 2 scope captures on Power Up of the PHY TX_EN signal with the PHY receiving packets on one of its ports and transmitting to the MCU over RMII.
The 1st pic is with the PHY TX_EN Connected to the NXP LPC1768 ENET_CRS, the 2nd one with TX_EN NOT Connected.
PHY TX_EN Connected to NXP1768
When the pin is connected to the MCU there is some very strange behavior then continuous pulses from 0-2.2V.
PHY TX_EN not connected to NXP1768
As you can see when not connected the signal contains repeating pulses from 0-3.3V
Any idea what is going on? or why the MCU pin connected is causing the signal to be reduced to 2.2V?
I also tried setting the pin functions to GPIO Inputs (function 0) and tested with all the resistor modes, pull-up / repeater / Neither pull-up nor pull-down / pull-down, but get the same results. Also tested on 4 different boards.
I have other boards with a different MCU working with this PHY, and the same MCU working with other PHY chips using the same connections. With this MCU the PHY indicates it is up and running and scope captures show it is transmitting, but a connected MCU corrupts the signals.
Again, any suggestions greatly appreciated. We are starting to go out of our minds on this.
Thanks
Dave