Reply by Tom Tang July 21, 20102010-07-21
This problem has been discussed many times on this group.
It's related to either the errata from NXP website or the
wrong hardware connection between the MAC and PHY.
It seems that you are aware of the errata. But, again, check
how you connect the txc/ref_clk.

Maybe search with keyword "MAC1" to find the answer.

Tom
--- In l..., "mirsaeed_h" wrote:
>
> i have a problem in initialize Ethernet,
> i work with LPC2478 and phy module is KS8721,
> my code is below :
>
> PCONP_bit.PCENET = 1;
> POWERDOWN_bit.POWERDOWN = 0;
>
> // Pins assignment
> //------------------
> // Write to PINSEL2/3 to select the PHY functions on P1[17:0]
> // P1.6, ENET-TX_CLK, has to be set for Rev '-' devices and it
> // must not be set for Rev 'A' and newer devices
> //------------------
> Reg = MAC_MODULEID;
> if ( Reg == OLD_EMAC_MODULE_ID )
> {
> // On Rev. '-', MAC_MODULEID should be equal to OLD_EMAC_MODULE_ID, P1.6 should be set.
> PINSEL2 = 0x50151105;
> // selects P1[0,1,4,6,8,9,10,14,15]
> }
> else
> {
> // on rev. 'A', MAC_MODULEID should not equal to OLD_EMAC_MODULE_ID, P1.6 should not be set.
> PINSEL2 = 0x50150105;
> // selects P1[0,1,4,8,9,10,14,15]
> }
>
> PINSEL3 = 0x00000005;/* selects P1[17:16] */
>
> // Reset entire MAC
> MAC1 = 0x0000CF00;
>
> COMMAND = 0x0038; // reset all control registers
> for(i=0 ; i< 20 ; i++); // short delay
> MAC1 = 0;
> on this point microcontroller was to hang .
>
> Has anyone faced this problem?
>
> Thanke you for any advice.
>
> Best regard
> saeed
>

An Engineer's Guide to the LPC2100 Series

Reply by mirsaeed_h July 21, 20102010-07-21
i have a problem in initialize Ethernet,
i work with LPC2478 and phy module is KS8721,
my code is below :

PCONP_bit.PCENET = 1;
POWERDOWN_bit.POWERDOWN = 0;

// Pins assignment
//------------------
// Write to PINSEL2/3 to select the PHY functions on P1[17:0]
// P1.6, ENET-TX_CLK, has to be set for Rev '-' devices and it
// must not be set for Rev 'A' and newer devices
//------------------
Reg = MAC_MODULEID;
if ( Reg == OLD_EMAC_MODULE_ID )
{
// On Rev. '-', MAC_MODULEID should be equal to OLD_EMAC_MODULE_ID, P1.6 should be set.
PINSEL2 = 0x50151105;
// selects P1[0,1,4,6,8,9,10,14,15]
}
else
{
// on rev. 'A', MAC_MODULEID should not equal to OLD_EMAC_MODULE_ID, P1.6 should not be set.
PINSEL2 = 0x50150105;
// selects P1[0,1,4,8,9,10,14,15]
}

PINSEL3 = 0x00000005;/* selects P1[17:16] */

// Reset entire MAC
MAC1 = 0x0000CF00;

COMMAND = 0x0038; // reset all control registers
for(i=0 ; i< 20 ; i++); // short delay
MAC1 = 0;
on this point microcontroller was to hang .

Has anyone faced this problem?

Thanke you for any advice.

Best regard
saeed