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?