DP83826I: How to calculate TDR cable diagnostic

Part Number: DP83826I


I am trying to code as to how find TDR cable diagnostic in case link is down. Below is the logic I am using:

 

Read register 0x170 add to its value bit 14,13 as b'10

Write the updated value to register 0x170

Read register 0x1E

Set bit 15 high to read value and write back to regioster 0x1E

Now in loop read register 0x1E in loop until register 0x1E bit 0 or 1 is hgh

If bit 1 read was high use the following logic to calulate the distance:

Read register 0x0180 (for Peak 1) to get the hexadecimal value.
   Hex to Decimal (DV): Convert the hexadecimal value to  a decimal value.
   Intermediate Location (IL):
   IL=(DV x 0.8621)-8
   Final Location (FL) in Meters:
   FL=IL+((70-IL) *0.01) 

Please let me know if this is the right way to calculate cause in some other document I find below formulas to compte:

1. Convert 0x180[7:0] to decimal value (DV).
2. Round off (DV-7) / 1.3 to the nearest integer and call it PL.
PL is location of peak in meters

Which is the right approach to do so?

  • Also is it possilble to calculate Phy port cable diagnostic when the PHY port is disabled? Is it valid to calculate the same for a PHY port when it is disabled?

  • Hi Prakash, 

    Have you taken a look at the TDR application note
    This app note discusses TDR implementation and analysis quite well and has an example code in MATLAB. 
    The cable diagnostic will still work when the PHY port is disabled from the OS side since this only pertains to the MDI connection. The MDI connection will happen regardless of the PHY port's status to the OS as long as the PHY is powered. 

    Best,
    J