Content originally posted in LPCWare by ajabo on Wed Aug 17 01:56:46 MST 2011
Quote: CodeRedSupport
This EMAC code has been tested with both PHYs (it was originally written for our RDB1768 board which exists in two versions - with the change in PHY being one of the differences).
However it is possible that there could be an issue here that only shows up with particular network setups. Could you attach your modified version of the code to this thread ?
Regards,
CodeRedSupport
I have rearranged and combined code from tcpip.c and ethmac.c, stripped the TCP (performance issue) and added UDP, eliminated the extra buffers (now building packets directly into assigned EMAC buffers to save one memcpy for every transmission) and got my own udpip.c/h, in which the difference in initializing the PHY's can be seen in initDP83848C() and initLAN8720() both called from within udpipInit() once the phyid is determined.
When running this in a looping foreground (and not accessing slow stuff like polling I2C transfers) I can get a response to a UDP message in 0.3 ms (verified using WireShark), so that is pretty good. Throughput is also pretty good, managing easily to receive 320kilobytes of data per second from the little LPCXPRESSO.
Check it out: [ATTACH]533[/ATTACH]
Aart