Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Ethernet Driver - Switching from RMII mode to MII mode

Status
Not open for further replies.

SAKU

Newbie level 5
Joined
Jul 23, 2011
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,542
Hello,

I'm using the DP83848H in the RMII mode now.

I need to change it to the MII mode.

Can somebody please throw light on :
what changes does the interface require - wrt to both software and hardware?

Already 50MHz crystal has been replaced by 25MHz crystal which is a requirement for MII.
what other changes are required?
Also the Software changes?

Thanks in advance.

-SAKU
 

Hi Saku,

I looked through the datasheets and other than the crystal requirement, it looks like just setup by the driver.

BigDog
 

Hello Bigdogguru...

you are right. the remaining settings have to be made in the software.
I have made a few changes in the software, following the datasheet and registers required for MII but i'm not able to accomplish successful TX or RX..


Can you suggest the changes for software in the driver... i will compare them with the ones i have made..


Thanks again.
-SAKU
 

I can see if I can scrounge up some example code. Unfortunately, I do not have anything handy.

What is the host system and OS?

You may want to take a look at some open source drivers like Linux and see if you find any clues.

BigDog
 

The host system is LPC2478 eval board.
OS : Windows XP

For your reference i have made the following changes in my code:

--------------------------
Original for RMII:
/* Initialize MAC control registers. */
MAC_MAC1 = MAC1_PASS_ALL;
MAC_MAC2 = MAC2_CRC_EN | MAC2_PAD_EN;
MAC_MAXF = ETH_MAX_FLEN;
MAC_CLRT = CLRT_DEF;
MAC_IPGR = IPGR_DEF;

/* Enable Reduced MII interface. */
MAC_COMMAND = CR_RMII | CR_PASS_RUNT_FRM;




For MII :

/* Initialize MAC control registers. */
MAC_MAC1 = MAC1_PASS_ALL;
MAC_MAC2 = MAC2_CRC_EN | MAC2_PAD_EN;
MAC_MAXF = ETH_MAX_FLEN;
MAC_CLRT = CLRT_DEF;
MAC_IPGR = IPGR_DEF;

/* Enable and Reset MII interface. */
MAC_MCFG = MCFG_RES_MII; //Reset MII
for (tout = 100; tout; tout--); //delay after reset
MAC_MCFG = MCFG_DIV10_MII; //Div clk by 10
MAC_COMMAND &= ~0x00000200; //MII mode selected
-------------------------------


But it doesnt seem to work.

I am using HTTP over TCP/IP and viewing the data on Google Chrome.
It works fine for RMII but doesnt work after the changed settings.

Can you please take a look into it.

Thanks in advance.

-SAKU
 

There is a mistake in one of the settings that i found: Marked in RED

--------------------------
Original for RMII:
/* Initialize MAC control registers. */
MAC_MAC1 = MAC1_PASS_ALL;
MAC_MAC2 = MAC2_CRC_EN | MAC2_PAD_EN;
MAC_MAXF = ETH_MAX_FLEN;
MAC_CLRT = CLRT_DEF;
MAC_IPGR = IPGR_DEF;

/* Enable Reduced MII interface. */
MAC_COMMAND = CR_RMII | CR_PASS_RUNT_FRM;




For MII :

/* Initialize MAC control registers. */
MAC_MAC1 = MAC1_PASS_ALL;
MAC_MAC2 = MAC2_CRC_EN | MAC2_PAD_EN;
MAC_MAXF = ETH_MAX_FLEN;
MAC_CLRT = CLRT_DEF;
MAC_IPGR = IPGR_DEF;

/* Enable and Reset MII interface. */
MAC_MCFG = MCFG_RES_MII; //Reset MII
for (tout = 100; tout; tout--); //delay after reset
MAC_MCFG = MCFG_DIV10_MII; //Div clk by 10
MAC_COMMAND = MII_MODE //i.e. 0x00000000 = MII mode selected
------------------------------

but the program is still not working...
Please let me know if you can find any thing else..


-SAKU
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top