Ethernet PHY
Topic last updated
11 Jun 2012, by
X M.
78 replies
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
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
Ah ok I understand now!
Do you think to solder all the pcb by yourself?
All hand assembled, by me.
Here is one I made earlier,

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
- 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
That board is amazing for prototyping!
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.
Thanks,
That board is amazing for prototyping!
I aim to please :)
Damn!!!!!!!
Why do you want to change micro?
Maybe could be a sw problem.. Let's think..
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.
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
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.
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?
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.
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)?
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.
When i get back thisafternoon, will patch out RJ45 connector to my
coolcomponents board,
forgot to order RJ45 connectors.
Ceri
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?
just copied it to KEIL,
TOO BIG to compile
?
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!
How much was the license ?
Cheers
Ceri.
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.
Just done a comparison betwwen the conections of LPC1768/LPC2368 MBED's and the respective PHY chips,
as well my own PCB:
| MBED lpc1768 | MBED 2368 | My LPC1768 | 'J' - PHY | leaded PHY |
| | | | |
| p1.8 - crs | p1.8 - crs | p1.8 | crs/dv led cfg | crs/dv led cfg |
| p1.14 - rx-er | p1.14 - rx-er | p1.14 | rx er/mdix en | rx er/mdix en |
| p1.9 - rxd 0 | p1.9 - rxd 0 | p1.9 | rxd 0/phyad1 | rxd 0/phyad1 |
| p1.10 - rxd 1 | p1.10 - rxd 1 | p1.10 | rxd1/phyad2 | rxd1/phyad2 |
| p1.4 - tx en | p1.4 - tx en | p1.4 | tx en | tx en |
| p1.0 - txd 0 | p1.0 - txd 0 | p1.0 | txd 0 | txd 0 |
| p1.1 - txd 1 | p1.1 - txd 1 | p1.1 | txd 1 | txd 1 |
| p1.16 - mdc | p1.16 - mdc | p1.16 | mdc | mdc |
| p1.17 - mdio | p1.17 - mdio | p1.17 | mdio | mdio |
| p1.28 - eth reset | RESET | p1.28 - e-reset | reset-n | reset-n |
| p1.25 - led link | p1.25 - led link | p1.25 - led link | led link/an0 | led link/an0 |
| p1.26 - led speed | p1.26 - led speed | p1.26 - led speed | led speed/an1 | led speed/an1 |
| | | | |
| p1.15 - rx clk | | p1.15 | 50MHZ | 50MHZ |
| | | | |
| p1.27 - e OSC EN | | | |
| | | | |
| p1.24led act | | | led act/col/an en |
| p1.15 | | | 25MHZ |
| | | | |
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.
| MBED lpc1768 | MBED 2368 | My LPC1768 | 'J' - PHY | leaded PHY |
| | | | |
| p1.8 - crs | p1.8 - crs | p1.8 | crs/dv led cfg | crs/dv led cfg |
| p1.14 - rx-er | p1.14 - rx-er | p1.14 | rx er/mdix en | rx er/mdix en |
| p1.9 - rxd 0 | p1.9 - rxd 0 | p1.9 | rxd 0/phyad1 | rxd 0/phyad1 |
| p1.10 - rxd 1 | p1.10 - rxd 1 | p1.10 | rxd1/phyad2 | rxd1/phyad2 |
| p1.4 - tx en | p1.4 - tx en | p1.4 | tx en | tx en |
| p1.0 - txd 0 | p1.0 - txd 0 | p1.0 | txd 0 | txd 0 |
| p1.1 - txd 1 | p1.1 - txd 1 | p1.1 | txd 1 | txd 1 |
| p1.16 - mdc | p1.16 - mdc | p1.16 | mdc | mdc |
| p1.17 - mdio | p1.17 - mdio | p1.17 | mdio | mdio |
| p1.28 - eth reset | RESET | p1.28 - e-reset | reset-n | reset-n |
| p1.25 - led link | p1.25 - led link | p1.25 - led link | led link/an0 | led link/an0 |
| p1.26 - led speed | p1.26 - led speed | p1.26 - led speed | led speed/an1 | led speed/an1 |
| | | | |
| p1.15 - rx clk | | p1.15 | 50MHZ | 50MHZ |
| | | | |
| p1.27 - e OSC EN | | | |
| | | | |
| p1.24led act | | | led act/col/an en |
| p1.15 | | | 25MHZ |
| | | | |
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
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.
Please log in to post a reply.
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