LAN8742 use with harmony and PIC32MZ dev Kit.
I'm wanting too use a LAN8742 Phy in my projects, as its lower cost, uses less energy and needs less external parts than its brother than 8740. Unforuatnly there is no daughter card for the LAN8742 for the dev kit so I am rattling one up.
Altium v17 schematics and board layout in a public git repo. ( theres a pdf of the schematic as well, if you dot' have altium.
the 8742 is quite similar, but enitrely the same as the 8740.
At the driver level it looks like there will only need to be one change from the 8740
It will most likely work with some minimal effort.
The differences between specific Harmony PHY drivers are implemented in the so called drv_ethphy.h:: DRV_ETHPHY_OBJECT.
This object exposed 4 functions:
- wolConfigure (you don’t need to worry about this is in there just for future development).
Please kook through the 8742 data sheet and make sure that the functions that are written for 8740 make sense for 8742 as well.
For example, most likely the miiConfigure should be changed like this:
static DRV_ETHPHY_RESULT DRV_EXTPHY_MIIConfigure(const DRV_ETHPHY_OBJECT_BASE* pBaseObj, DRV_HANDLE hClientObj, DRV_ETHPHY_CONFIG_FLAGS cFlags)
return (cFlags & DRV_ETHPHY_CFG_RMII) ? DRV_ETHPHY_RES_OK : DRV_ETHPHY_RES_CFG_ERR;
Since the 8742 supports only RMII mode.
Probably the other 2 functions should be OK as they are, but still need to be verified.
Bottom line, it’s very easy to write a new Harmony PHY driver, because only these very simple functions need to be supported.
In theory having looked at the datasheet, I think rainad is pretty much correct. will need to copy the drv_exphy_smsc8740.c from framework/driver/ethphy and create a drv_extphy_lan8742.c and its respective .h file.
Anybody spot anything else that needs doing?
I'm just going to order some pcbs today, and parts, though i dont' expect we will get to them until the new year now.