Ethernet LEDS

27 Jan 2011

As my ethernet jack has 2 leds, I am trying to get them to work.

I have seen that the PHY has 2 led outputs that are connected to P1_26 and P1_26 respectively. But when I connect a DigitalIn to those pins I don't see any values showing up there. What am I missing here?

I know I could use the link function, but my goal would be to make the led settings interrupt driven... How do I go about reading the link speed/duplex settings?

My second question is about the code of the network stack. I don't seem to be able to find how the PHY is programmed there. Is this part of the MBED BIOS?

Louis

28 Jan 2011

Louis Lagendijk L wrote:

... How do I go about reading the link speed/duplex settings?

You could use something like this to sample the PHY status signals:

    led_link  = LPC_GPIO1->FIOPIN & (1<<25);       // GPIO1.25 = "LED_LINK". 
    led_speed = LPC_GPIO1->FIOPIN & (1<<26);       // GPIO1.26 = "LED_SPEED". 

Then use your interrupt routine to keep the leds updated.

-hb

04 Feb 2011

I'm build an own board with DP83848C (LQFP48). I used an Amphenol socket with two LED. When i download an mbed online compiled fw, the LPC is freeze on PHY init. But! when i compile a keil sample (easy_web), the board work correctly...

The PHY schema: /media/uploads/kubichris/phy.png

The mbed code:

#include "mbed.h"

DigitalOut myled(LED1);

void showtime(){
    struct tm t;
    time_t seconds = time(NULL);
    printf("current date and time: %s \r\n", ctime(&seconds));
}

int main() {
        myled = 0;
        wait(0.5);
        myled = 1;
        wait(0.5);
        showtime();        

        printf("before ETH\r\n"); //Already sended...
        
        Ethernet eth; //<- freez in own board!
        
        printf("after ETH\r\n"); //Nothing

        while (1)
        {
         showtime();
         myled = 0;
         wait(0.5);
         myled = 1;
         wait(0.5);
        }        

}

I think the problem is the LED_SPEED and LED_LINK wire, because this two wire is an config pin on PHY, and in the keil code is not initialized and used

Something any idea?...

And finally, sorry for my English "speak"....

01 Mar 2011

Yes, that could be the cause. You don't need to connect those LED pins to P1. The PHY chip handle the LED directly, no need for you to handle it by software. By connecting it to P1, you have 2 i/o conflicting on the control of the LEDs.

01 Mar 2011

Anyone figured out the code for controlling the LEDs using the Cool Components base board? http://www.coolcomponents.co.uk/catalog/product_info.php?products_id=608

01 Mar 2011

Thank you, for reply:

Yoko Hama wrote:

Yes, that could be the cause. You don't need to connect those LED pins to P1. The PHY chip handle the LED directly, no need for you to handle it by software. By connecting it to P1, you have 2 i/o conflicting on the control of the LEDs.

The realy problem in the eth init:

Chris Styles's reply to my private mail:

"check is that you have set up the mac, as described in the details section of http://mbed.org/handbook/Ethernet This is an important step because without this the LPC1768 will try to communicate with the mbed interface over JTAG, which of course is not present on your board. This would cause it to hang fairly early on."

And it's the solution to my problem ....

06 Jul 2014

I have built my own lpc1768 board and I am facing the same blocking issue with the Ethernet interface. I have used a NO-OS lwip stack library contained in an early precompiled mbed library without OS support. So I have these questions: Where I should define this “mbed_mac_address(char * mac)” function?

Does this function apply to my NO-OS lwip and mbed library?

What is the format of data returned by this function?

Finally I am using PHY DP83848I. Is it better no to connect Link neither speed signals to lpc P1.25 and P1.26? I really appreciate your comments.best