I am interfacing ARM Controller LPC2378 with DP83848C Ethernet Physical Layer Transceiver. I have downloaded a code for ethernet related to the above interface called -EasyWEB- from NXP. While compiling the program, it was not showing any error. But while running the program in my board it was Hanging. As soon as it reach -MAC_COMMAND- to execute the instruction in -Init_EMAC- function, the program Hangs over there:
void Init_EMAC(void) { /* Power Up the EMAC controller. */ PCONP = PCONP | 0x40000000; /* Enable P1 Ethernet Pins. */ if ( MAC_MODULEID == OLD_EMAC_MODULE_ID ) PINSEL2 = 0x50151105; else PINSEL2 = 0x50150105;
PINSEL3 = ( PINSEL3 & ~0x0000000F ) | 0x00000005;
/* Reset all EMAC internal modules. */ MAC_MAC1 = MAC1_RES_TX|MAC1_RES_MCS_TX|MAC1_RES_RX| MAC1_RES_MCS_RX|MAC1_SIM_RES| MAC1_SOFT_RES;
MAC_COMMAND = CR_REG_RES | CR_TX_RES | CR_RX_RES; :
:
Since the code was hanging in -MAC_COMMAND, I modified the code. I brought the Command register before the Power Control (PCONP) register to Reset the Rx, Tx and RegReset bit. Then the program was working properly. I was able to write and read to/from DP83848C, I was able to get the correct PHY ID. But I was not able to Initialise Tx and Rx DMA Descriptors. While in the function -rx_descr_init- it gets hanged in the instruction -MAC_RXSTATUS-.
Now I am trying to look for example code to run Ethernet in LPC2378, my interface IC is DP83848C Can anyone help me for this
Naveen Cali
Plz Anyone of you help me in this
Hi Naveen,
I think the Problem is,
LPC2378 chip has the different versions.
Rev "-", Rev "A" and Rev "B"
The Ethernet pin selection in the demo code is for the Rev "-" chip.
check your chip version.....and change the pins
with regards, Murthy.R
Hai Murthy
Thanks Yaar, But Now I have Changed that I am not Using LPC2378, I am using Luminary Micro LM3S6963, Bcos it has in build PHY.
Thanks A lot for Your Reply Naveen