Ethernet PHY DP83848 to DM9161

19 Jan 2013

I started coding on a cheap LPC1768 board (bought on E-bay: LPC1768 mini-DK).

This board has 2.8" SPI TFT + SPI touch (ADS7843 compatible) + DM9161 Ethernet PHY + card reader (TF SD/MMC).

The LCD and touchpanel are already working. I used Peter Drescher's code (http://mbed.org/cookbook/SPI-driven-QVGA-TFT) as a starting template because printf to the LCD was a must. I threw out all DMA code, used default SPI code, replaced init code, modified several routines (circle/fillcircle -> ellipse, modified rect, fillrect), ... , added the ADS7843 calibration and read routines based on Carlos E. Vidales tutorial : How To Calibrate Touch Screens (http://www.embedded.com/design/configurable-systems/4023968/How-To-Calibrate-Touch-Screens).

Now i want to add the ethernet PHY = DM9161AEP (Davicom).

The kit has Keil sample code (written in plain C) for the PHY (easyweb app). Register settings for the DM9161 were added to the emac files but they also contain references to the DP83848 and CS8900 PHY chips (confusing - see annexed file containing the emac code : /media/uploads/frankvnk/easyweb_emac_files_-dm9161a-.zip)

Has anyone already used the LPC1768 + DM9161 using the lwip library (mbed uses the DP83848J PHY) or done any research on the compatibility level between these PHYs (I already compared the datasheets : some registers are different)?

Is it difficult to modify/port the old TCP/IP networking or the newer lwip networking stack to the DM9161AEP PHY?

Will this work when i modify the emac.c and emac.h (from http://mbed.org/handbook/Ethernet-Interface) register data to match the DM9161EAP (or do i only need to modify the lpc_phy_dp83848.c file)?

I compared the mbed and mini-DK schematics: mbed pins LED_LINK (p1.25), LED_SPEED (p1.26), ETH_OSC_EN (p1.27) and ETH_RESET (p1.28) are not used on the mini-DK. Where can i disable these pins?

Update

I already got the EasyWeb code working. I'd really like to switch to the lwip based code. Since this code is far more complex than the EasyWeb code: Can anyone assist me in how to add DM9161AEP functionality to the lwip code?

19/01/2013 - Edit

Got the PHY partially working - see 'DM9161 Ethernet CODE - Networking, lwip based (19/01/13)' note on http://mbed.org/users/frankvnk/notebook/lpc1768-mini-dk/ (autonegotiation and DHCP). For now, i'm stuck at the ethernet part. Can anyone help with this problem?