How to set the PHY address for LAN8720A

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set the PHY address for LAN8720A

5,059 Views
chaitannyamahat
Contributor II

Hi ,

I am programming a custom board based on MK60DN512 chip.

We are using LAN8720A as a PHY device. Tricky part is determing /setting the PHY ID.

I don't know what is the default ID. In the datasheet they have mentioned that the we have to assert RXER pin low to set the PHY ID. How to assert RXER pin low when it is not configure as GPIO.

I have written a simple code which tries to read the PHY_PHYIDR1 register of LAN8720. I am not getting any valid data.

do

  {

    vTaskDelay( netifLINK_DELAY );

    usData = 0xffff;

    ret=mii_read( 0, id, PHY_PHYIDR1, &usData );

    id++;   

  } while( usData == 0xffff);

Labels (1)
Tags (3)
0 Kudos
3 Replies

2,432 Views
mjbcswitzerland
Specialist V

Hi

The PHY address depends on the PULL-UP / PULL-DOWN resistors on its STRAP inputs as the PHY exits reset.

If you read on all possible PHY addresses (which I think you are doing) but don't get an answer it is likely to be a HW problem. Do you have a pullup resistor on the MDIO line? Also you could check the clock rate that the interface is sending to ensure that it is not too fast (2.5MHz is typical max. speed).

Regards

Mark

2,432 Views
trilokjt
Contributor III

Hi,

I have same issue,on MDC pin I'm getting around 4.5Mhz clock, Please tell how to sort out the Problem.

0 Kudos

2,432 Views
chaitannyamahat
Contributor II

Hello Mark,

Thanks for your valuable insight.

I have verified the straps , MDIO is OK.

I tried the same program on Tower board, works fine. I think the issue is with hardware, investigating that time being.