Ethernet Transceiver Reset

06 Jul 2010

In my project I need to be able to control when the ethernet transceiver attempts to do its first autonegotiate linkage.  I see that there is an ETH_RST line brought to the LPC1768 from the DP83848 tranceiver which has me intrigued.  Could I hold the transceiver in reset using this line and then release it so that it does the first autonegociate when I want it to?  If so, please post the example code.

Thanx,

Barry

06 Jul 2010

The Ethernet class performs the initialisation and autonegotiation in the constructor. What you *could* do is just define the pointer to the ethernet class, then use the dynamic creation of the object when you needed it:

Ethernet *ethif;

// Some other code here
// Now I'm ready...

ethif = new Ethernet;

06 Jul 2010

Thanx Jon,

I have already tried that approach but we still are having problems with reliably linking after the first successful linkage.  A little background is in order here.  The mbed is the heart of a PCB test fixture which requires that I test linkage and comms to a couple of ethernet ports on the board being tested, all driven from the one multiplexed mbed port. I currently create a new Ethernet object (as you suggested above) before each port test and destroy it at the end of the first phase of the test, then create a another new Ethernet object for the second phase of the test.  

So I was thinking that the transceiver may perform the autonegotiation automatically after powerup even without being instantiated yet.  In the mbed library, can you tell me if the ETH_RST line is held logic 0 until the Ethernet object is created?  Better still, is it possible to see the source code for the Ethernet constructor?

It is also possible the analog multiplexer is causing problems (crosstalk, mismatched impedances, etc) and the sparkies are working that angle.

Barry 

 

07 Jul 2010

Well, ETH_RST is on Port 1, pin 28. You could define a digital out on that pin, and hold it low until you are ready:

DigitalOut ethrst(P1_28);
ethrst = 0;


07 Jul 2010

Thanx, I was hoping it was that simple.  Could you tell me how the mbed library code treats this output since with your suggested approach both the library and I will be controlling it?

07 Jul 2010

At the moment, it doesn't do anything with it, but that may not be true in the future. If you just re-enable it (set it to '1') before you create your ethernet object, you should be OK. If you have it held low while creating the ethernet object, the results are Undefined (and probably not good).