M52233DEMO and Testing Full duplex

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

M52233DEMO and Testing Full duplex

1,763 Views
BW
Contributor I
I have a M52233DEMO board running OpenTCP. When I use auto negotiation and advertise the defaults (100baseT, full duplex, no flow control) my linksys router has the Full/Col LED on. When I set the PHY up for these settings without auto negotiation, the routers Full/Col LED is off (The DUP LED on the demo board is on though). I quess I can understand this since I don't think I've told the router anything about the device, but does anyone know if this is correct? Also, if the router is defaulting to half duplex, should I just use half duplex?

brwiese
Labels (1)
0 Kudos
Reply
2 Replies

760 Views
BW
Contributor I
To set up the PHY, you write the address of the PHY into EPHYCTL1 (might as well just make this 0), then setup the EPHYCTL0 for what you want, (if you're not using autoneg. both the 100 and 10 PLL's need to be on). You then need a delay until you can write the MII. The following seems to work:

//DELAY, Delay start-up
for (myctr=200000; myctr >0; myctr--)
{
}

There should be a mii.c and mii.h in your project if you're using the coldfire stationary. The last thing I set up in my main.c is the MII. I call the fec_mii_init and fec_mii_blk_init and then I perform a fec_mii_write. I just write to the control register (register 0).

/********************************************************************/
/* Enable the MII interface and print MII registers
/********************************************************************/
fec_mii_init(SYSTEM_CLOCK);

/********************************************************************/
/* Clear MII block count registers and check that they are all clear.
/********************************************************************/
fec_mii_blk_init(); // intialize counter to zero

/********************************************************************/
/* Set up the Phy for 100 baseT, full duplex
/********************************************************************/
mii_test = fec_mii_write(0,0,0x2100);
if(mii_test != 1) sendtext("\r\n******MII write failed******\r\n");
else sendtext("\r\n******MII write OK******\r\n");

On the fec side of things all I change is the following in fec_reset in fec.c:

/* Setup transmitter */
MCF_FEC_TCR = MCF_FEC_TCR_FDEN; //full duplex

I think this works, I just don't know how to prove if its really operating in full duplex.
0 Kudos
Reply

760 Views
rsk2
Contributor I
Hello,
 
I am having similar questions but you may be ahead of me.  How do you set the MCF52233 for half or full duplex.  Using the EPHYCTL0 I see how you can turn auto-negotiate on/off but you have to set the registers in the MII to control the duplex mode, but I do not know how to access those registers.
 
Thanks,
Randy Kelso
rkelso@studio-tech.com
0 Kudos
Reply