English
Language : 

LM3S9B96_16 Datasheet, PDF (925/1406 Pages) Texas Instruments – Stellaris Microcontroller
Stellaris® LM3S9B96 Microcontroller
18.3.3.4
MDI/MDI-X Configuration
The Ethernet Controller supports the MDI/MDI-X configuration as defined in IEEE 802.3-2002
specification through software assistance. The MDI/MDI-X configuration eliminates the need for
cross-over cables when connecting to another device, such as a hub. Software can implement the
MDI/MDI-X configuration using a function outlined by the pseudo code below. This code should be
called periodically using one of the available timer resources on the Stellaris microcontroller such
as the System Tick Timer or one of the General Purpose timers. The following code refers to the
LINK bit in the Ethernet PHY Management Register 1 - Status (MR1), the ENON bit in the Ethernet
PHY Management Register 17 - Mode Control/Status (MR17), and the EN bit of the Ethernet
PHY MDIX (MDIX) register.
//
// Entry Point for MDI/MDI-X configuration.
//
//
// Increment the Link Active and Energy Detect Timers using the elapsed time
// since the last call to this function. If using a periodic timer, the
// elapsed time should be a constant (the programmed period of the timer).
//
Increment Link Active Timer
Increment Energy Detect Timer
//
if(No Ethernet Link Active)
{
//
// If energy has been detected on the link, reset the Energy Detect Timer.
// If it is a "new" energy detect, reset the link detect timer also.
//
if(Ethernet Energy Detected)
{
Reset Energy Detect Timer
if(New Energy Detect)
{
Reset Link Detect Timer
}
}
//
// If the Energy or Link Detect timer has expired, toggle the MDI/MDI-X
// mode. Typically, the Energy Detect Timer would be ~62ms, while the
// Link Detect Timer would be ~2s
//
if((Energy Detect Timer Expired) or
(Link Detect Timer Expired))
{
Reset Energy Detect Timer
if(Random Event)
{
July 03, 2014
925
Texas Instruments-Production Data