Hot!LAN8742 use with harmony and PIC32MZ dev Kit.

Author
mrpackethead
packet mangler
  • Total Posts : 952
  • Reward points : 0
  • Joined: 2007/04/01 23:33:39
  • Location: 0
  • Status: offline
2017/12/14 20:28:28 (permalink)
0

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
 
 
rainad
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:
  • miiConfigure
  • mdixConfigure
  • smiClockGet
  • 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.
 
 
 

Attached Image(s)

#1

2 Replies Related Threads

    mrpackethead
    packet mangler
    • Total Posts : 952
    • Reward points : 0
    • Joined: 2007/04/01 23:33:39
    • Location: 0
    • Status: offline
    Re: LAN8742 use with harmony and PIC32MZ dev Kit. 2017/12/14 20:28:55 (permalink)
    #2
    mrpackethead
    packet mangler
    • Total Posts : 952
    • Reward points : 0
    • Joined: 2007/04/01 23:33:39
    • Location: 0
    • Status: offline
    Re: LAN8742 use with harmony and PIC32MZ dev Kit. 2017/12/14 20:29:58 (permalink)
    0
    I have no idea why i was not able to post the url to the github repo in the first post, but thats the forum software for you.  If i just leave the url with NO text in it, its fine.  Add this message and it breaks.
    #3
    Jump to:
    © 2018 APG vNext Commercial Version 4.5