Ethernet PHY

12 Mar 2012

The differences about DP83848 PHY , seem to be 1. package 2. interfaces 3. temp range 4. price !!! Here is a nice summary of the different types http://eu.mouser.com/catalog/645/351.pdf

12 Mar 2012

Thanks Thanassis;

I an going to get the IVV, because I have already tried the CVV, I have had a quick look and the only difference is the cost £471 to £522

both appear to have the same functionality, and pin-outs.

the CVV does have an Eagle PCB part ? from Farnell.

As for the'J' I cannot see how to put that part down with out a solder mask & re-flow oven.

I do have accses to some good kit, but not that type of stuff.

Will order it today,

Cheers

Ceri

12 Mar 2012

My first mbed with LPC2368 had the QFP48 package of PHY. You can find the schematic here: http://mbed.org/media/uploads/mbedofficial/mbed-002.1.pdf With this design you can have access to the PHY leds also. (Of course IVV is working also without a problem with the LPC1768)

12 Mar 2012

I think I haven't understood.

What's the problem with DP83848J

http://search.digikey.com/us/en/products/DP83848JSQ%2FNOPB/DP83848JSQCT-ND/1302100

that is the part on the reference schematic?

It is also cheaper

Regards Giuseppe

12 Mar 2012

the 'j' version has no legs ! it is a lead-less package !

I am 98% sure it is only available in this tiny form factor.

which makes it difficult to make at home.

but it is good news that someone might actually have Ethernet working.

unfortunately, did not manage to order chip today :(

cheers

Ceri

12 Mar 2012

Ah ok I understand now!

Do you think to solder all the pcb by yourself?

13 Mar 2012

All hand assembled, by me.

Here is one I made earlier,

/media/uploads/ceri/_scaled_imag2163.jpg

The board has FTDI chip for Serial & Auto programming, USB/HID interface, as well as a footprint for a USB Socket, for memory stick etc.

Real RS232 connector, Several PSU options, Ethernet chip & RJ45 socket, Expensive ADC & DAC (each of them are more expensive than LPC1768)

Micro SD (on underside) Battery backup, 6 User LED's

Connector for QVGA screen, Unfolded. as well as a nice small I2C 96*40 Pixel screen (Big version of Nokia 3310 type ?)

And Lots of prototyping area.

Ceri

13 Mar 2012
  1. Thanassis Mavrogeorgiadis

Wow, just had a look on my LPC2368 MBED,

cannot imagine how I missed that !

but it has been buried in some kit i made a long time ago.

Cheers

Ceri

13 Mar 2012

That board is amazing for prototyping!

20 Mar 2012

Finaly got the IVV part, solderd it down, added the 3 'missing' resistors, Flashed the micro,

And a big fat nothing,

LPC1768 STILL does nothing, no sign of activity.

No flashing LED's or anything :(

My last resort is to compile it for LPC2368,

And try it with LPC 2368.

Ceri.

20 Mar 2012

Thanks,

Giuseppe Zangari wrote:

That board is amazing for prototyping!

I aim to please :)

  • Ceri
20 Mar 2012

Damn!!!!!!!

Why do you want to change micro? Maybe could be a sw problem.. Let's think..

21 Mar 2012

Lets take it step by step in order to find if it is hw or sw problem. Could you please program via flash magic the attached .hex file to your board. In my setup with LPC1768 & IVV part it is working and I can ping the board. The sw setup the ethernet and the board try to get ip via dhcp.

/media/uploads/tmav123/httpserverhelloworld_lpc1768.hex

You can check via uart1 port of lpc1768 with 9600bd the debug messages.

21 Mar 2012

AAAAARRRRRRRRRRRRRRRRGGGGGGGGGGGGGGGGGGGGGGGGG !!!!!!!!!!!!!

What did you do to make that work ??

on the board with IVV part, got an erron message ..

DHCP Started, waiting for IP...[..\fwk\if\eth\EthernetNetIf.cpp:setup@131]

Timeout.

Error -65534 in setup.

But I did not fit the RJ45 connector or the 50 Ohme resistors.

but on the CVV one :

Setting up...[..\fwk\if\eth\EthernetNetIf.cpp:setup@86]

HW Addr is : 00:02:f7:f0:45:be.[..\fwk\if\eth\EthernetNetIf.cpp:setup@99]

DHCP Started, waiting for IP...[..\fwk\if\eth\EthernetNetIf.cpp:setup@142]

Connected, IP : 192.168.51.137

Setup

OKListening...

and I got a web page Hello World :)

Please tell me what to do to make it work

Cheers

Ceri

21 Mar 2012

You can find the code here: http://mbed.org/cookbook/HTTP-Server

my code is the following:

#include "mbed.h"
#include "EthernetNetIf.h"
#include "HTTPServer.h"

EthernetNetIf eth;  
HTTPServer svr;

DigitalOut led1(LED1);

DigitalIn ENET_ACT(P1_24);
DigitalIn ENET_LINK(P1_25);
DigitalOut LedACT(LED4);
DigitalOut LedLINK(LED3);

extern "C" void mbed_mac_address(char *s) {
    char mac[6];
    mac[0] = 0x00;
    mac[1] = 0x02;
    mac[2] = 0xf7;
    mac[3] = 0xf0;
    mac[4] = 0x45;
    mac[5] = 0xbe;
    // Write your own mac address here
    memcpy(s, mac, 6);
}



int main() {
  printf("Setting up...\n");
  EthernetErr ethErr = eth.setup();
  if(ethErr)
  {
    printf("Error %d in setup.\n", ethErr);
    return -1;
  }
  printf("Setup OK\n");
  
  svr.addHandler<SimpleHandler>("/"); //Default handler
  svr.bind(80);
  
  printf("Listening...\n");
    
  Timer tm;
  tm.start();
  //Listen indefinitely
  while(true)
  {
    Net::poll();
    if(tm.read()>.5)
    {
      led1=!led1; //Show that we are alive
      tm.start();
    }
    if (!ENET_LINK)
      LedACT = ENET_ACT;
    else
      LedACT = 0;
    LedLINK = !ENET_LINK; 
  }
  
  return 0;
}

I just set the mac address (in mbed this exist in the magic chip) + read the status of the ethernet leds. If you don't set this mac address the lpc1768 is trying to communicate with the magic chip and it stack there.

21 Mar 2012

What is the difference of IVV & CVV? Are there placed on the same hardware? Did you followed the schematic of mbed-002.1.pdf in your board?

21 Mar 2012

Thanks for code, but I tryed it, and still frozen.

My version, has the same extern block, very slight difference in address,

but in your code, there is no call to "mbed_mac_address(?)".

This is my code ..

#include "mbed.h"
#include "EthernetNetIf.h"
#include "HTTPServer.h"

EthernetNetIf eth;
HTTPServer svr;

DigitalOut led1(LED1, "led1");
DigitalOut led2(LED2, "led2");
DigitalOut led3(LED3, "led3");
DigitalOut led4(LED4, "led4");

LocalFileSystem fs("webfs");


extern "C" void mbed_mac_address(char *s) 
{
    char mac[6];
    mac[0] = 0x00;
    mac[1] = 0x02;
    mac[2] = 0xf7;
    mac[3] = 0xf0;
    mac[4] = 0x44;
    mac[5] = 0xbe;

    memcpy(s, mac, 6);
}


uint64_t uid = 0;
char mmac[6];
char mac[6];

int main() 
{
    printf("Trying to overwrite MAC Address ..\r\n");

    mbed_mac_address(mmac);
    uid = mmac[0] << 40 | mmac[1] << 32 |
          mmac[2] << 24 | mmac[3] << 16 |
          mmac[4] << 8  | mmac[5] << 0;

    printf ("Here it is .. %02x %02x %02x %02x %02x %02x .. \r\n", mmac[0], mmac[1], mmac[2], mmac[3], mmac[4], mmac[5]);

    Base::add_rpc_class<DigitalOut>();

    printf("Setting up...\r\n");
    EthernetErr ethErr = eth.setup();
    if (ethErr) 
    {
        printf("Error %d in setup.\r\n", ethErr);
        return -1;
    }
    printf("Setup OK\n");

    FSHandler::mount("/webfs", "/files"); //Mount /webfs path on /files web path
    FSHandler::mount("/webfs", "/"); //Mount /webfs path on web root path

    svr.addHandler<SimpleHandler>("/hello");
    svr.addHandler<RPCHandler>("/rpc");
    svr.addHandler<FSHandler>("/files");
    svr.addHandler<FSHandler>("/"); //Default handler
    //Example : Access to mbed.htm : http://a.b.c.d/mbed.htm or http://a.b.c.d/files/mbed.htm

    svr.bind(80);

    printf("Listening...\r\n");

    Timer tm;
    tm.start();
    //Listen indefinitely
    while (true) 
    {
        Net::poll();
        if (tm.read()>.5) 
        {
            led1=!led1; //Show that we are alive
            tm.start();
        }
    }

    return 0;

}

I cannot see any differences,

what is the clever bit I am missing ??

Getting close tooooooo excited

Ceri.

21 Mar 2012

You don't need to call the mbed_mac_address function from your code. This is called from the mbed libraries and replaces the semihosting request to the mbed interface "magic chip" that it is missing in a board other than mbed. You can check details here: http://mbed.org/handbook/Ethernet

Have you tested the CVV and IVV with the same hw and sw (hex file posted above)?

21 Mar 2012

the code ran on both boards,

the IVV part came back with an error message - Because there is no RJ45 connector fitted (or 50 ohm Resistors)

the CVV part works,

I still dont understand why your .HEX file works and mine does not

can you send me your code so i can compair please.

Ceri.

21 Mar 2012

unbelievable!

21 Mar 2012

When i get back thisafternoon, will patch out RJ45 connector to my

coolcomponents board,

forgot to order RJ45 connectors.

Ceri

21 Mar 2012

The hex file produced from keil. But it is based to the http://mbed.org/cookbook/HTTP-Server source code exported for keil. Have you used this source code with the add of mbed_mac_address function and it is not working?

21 Mar 2012

just copied it to KEIL,

TOO BIG to compile

?

21 Mar 2012

You must have a keil license! I will try to compile the code to the online tool and test it with my board and let you know!

21 Mar 2012

How much was the license ?

Cheers

Ceri.

21 Mar 2012

I confirm that compiling the above code with the mbed compiler my board is also stack! Searching for a solution, I found that the same problem also had Kübler Krisztián. Check the following post: http://mbed.org/forum/mbed/topic/815/?page=1#comment-9624

It is strange that with keil it is working and not with the mbed compiler.

Basic version of Keil cost around 2K.

22 Mar 2012

Just done a comparison betwwen the conections of LPC1768/LPC2368 MBED's and the respective PHY chips, as well my own PCB:

MBED lpc1768MBED 2368My LPC1768'J' - PHYleaded PHY
p1.8 - crsp1.8 - crsp1.8crs/dv led cfgcrs/dv led cfg
p1.14 - rx-erp1.14 - rx-erp1.14rx er/mdix enrx er/mdix en
p1.9 - rxd 0p1.9 - rxd 0p1.9rxd 0/phyad1rxd 0/phyad1
p1.10 - rxd 1p1.10 - rxd 1p1.10rxd1/phyad2rxd1/phyad2
p1.4 - tx enp1.4 - tx enp1.4tx entx en
p1.0 - txd 0p1.0 - txd 0p1.0txd 0txd 0
p1.1 - txd 1p1.1 - txd 1p1.1txd 1txd 1
p1.16 - mdcp1.16 - mdcp1.16mdcmdc
p1.17 - mdiop1.17 - mdiop1.17mdiomdio
p1.28 - eth resetRESETp1.28 - e-resetreset-nreset-n
p1.25 - led linkp1.25 - led linkp1.25 - led linkled link/an0led link/an0
p1.26 - led speedp1.26 - led speedp1.26 - led speedled speed/an1led speed/an1
p1.15 - rx clkp1.1550MHZ50MHZ
p1.27 - e OSC EN
p1.24led actled act/col/an en
p1.1525MHZ

The only differences I can see is that the LPC2368 has an extra line, LED Activity, and recives 25MHz not 50MHz.

What I realy do not understand is the code Thanassis Mavrogeorgiadis sent me works,

the only difference is he used KEIL to compile it,

BUT it was generated from MBED export.

Has anyone else got Ethernet to work ??

Cheers

Ceri.

22 Mar 2012
MBED lpc1768MBED 2368My LPC1768'J' - PHYleaded PHY
p1.8 - crsp1.8 - crsp1.8crs/dv led cfgcrs/dv led cfg
p1.14 - rx-erp1.14 - rx-erp1.14rx er/mdix enrx er/mdix en
p1.9 - rxd 0p1.9 - rxd 0p1.9rxd 0/phyad1rxd 0/phyad1
p1.10 - rxd 1p1.10 - rxd 1p1.10rxd1/phyad2rxd1/phyad2
p1.4 - tx enp1.4 - tx enp1.4tx entx en
p1.0 - txd 0p1.0 - txd 0p1.0txd 0txd 0
p1.1 - txd 1p1.1 - txd 1p1.1txd 1txd 1
p1.16 - mdcp1.16 - mdcp1.16mdcmdc
p1.17 - mdiop1.17 - mdiop1.17mdiomdio
p1.28 - eth resetRESETp1.28 - e-resetreset-nreset-n
p1.25 - led linkp1.25 - led linkp1.25 - led linkled link/an0led link/an0
p1.26 - led speedp1.26 - led speedp1.26 - led speedled speed/an1led speed/an1
p1.15 - rx clkp1.1550MHZ50MHZ
p1.27 - e OSC EN
p1.24led actled act/col/an en
p1.1525MHZ
26 Mar 2012

I thought I would take a look at this code and try adding some instrumentation to see if I could help narrow down the cause of the difference you are seeing between the online and offline compiler but I am not sure that I have managed to learn anything. When I added the instrumentation, it does appear that the mbed_mac_address() override is being called instead of the semi-host version which would attempt to break into the interface chip. I wonder if it is possible that the mbed_mac_address() function override might not be the cause but something else is awry.

I pulled in the HTTPServerHelloWorld project and updated the main code to match what Thanassis posted above. I then added some instrumentation which should fire if the code tried to use the semi-host version of mbed_mac_address. This version starts up and runs on my mbed device as I would expect and that instrumentation doesn't fire.

Ceri, would you be able to try running my binary on your board and letting me know what gets dumped to UART0 (9600 8-N-1)? It was compiled with the online compiler so I would hope that it has the same problem you saw with your build but still let me know if it does bring up the network successfully or not.

Thanks,

Adam

26 Mar 2012

Thank you for your intrest,

It is good to have someone else's input.

Just tryed it -

Dead fish,

no life at all,

I just cannot understand it,

Most annoying of all is Thanassis Mavrogeorgiadis code works, but that was with KEIL compiler,

I cannot justify, or afford £2K, or more.

Question, why does the micro hang, befor any code gets executed, - I am assuming that it is because PHY ini stuff goes first,

I would love to try the 'J' version, but that would be a new PCB, that is a lot of money

Espesialy if it does not work !!

Cheers

Ceri.