Part Number: LMH0395
Hi Team,
We need your help to check our cusotmer's concern as stated below.
The LMH0395 measures the length of cable input by a register but I read always 0 , the other functions and register are ok. Why?
I use the arduino and I read the variable in this way
uint8_t lmh0395_get_cable_length(uint8_t rate)
{
uint8_t length;
uint8_t cli;
bool err;
//err = spi_sdi_read(LMH0395_CABLE_LENGTH_INDICATOR, &cli);
err = spi_sdi_read4(LMH0395_CABLE_LENGTH_INDICATOR, &cli);
/* The cable length indicator (CLI) provides an indication of the
* length of the cable attached to input. CLI is accessible via bits
* [7:0] of SPI register 06h.
* The 8-bit setting ranges in decimal value from 0 to 247
* ("00000000" to "11110111" binary), corresponding to 0 to 400m of
* Belden 1694A cable.
* For 3G and HD input, CLI is 1.25m per step.
* For SD input, CLI is 1.25m per step, less 20m, from 0 to 191 decimal
* and 3.5m per step from 192 to 247 decimal.
*/
length = rx_sdi[1]*5/4;
if (rate == 0) {
if (rx_sdi[1] <= 191)
length -= 20;
else
length = ((191*5/4)-20) + ((rx_sdi[1]-191)*7/2);
}
char s[70];
sprintf(s, "Length estimated IN4 (BELDEN 1694A cables) : %dm \n",length);
Serial.println(s);
//------------------------------------------
length = rx_sdi[3]*5/4;
if (rate == 0) {
if (rx_sdi[3] <= 191)
length -= 20;
else
length = ((191*5/4)-20) + ((rx_sdi[3]-191)*7/2);
}
sprintf(s, "Length estimated IN3 (BELDEN 1694A cables) : %dm \n",length);
Serial.println(s);
//----------------------------------------------
length = rx_sdi[5]*5/4;
if (rate == 0) {
if (rx_sdi[5] <= 191)
length -= 20;
else
length = ((191*5/4)-20) + ((rx_sdi[5]-191)*7/2);
}
sprintf(s, "Length estimated IN2 (BELDEN 1694A cables) : %dm \n",length);
Serial.println(s);
//----------------------------------------------
length = rx_sdi[7]*5/4;
if (rate == 0) {
if (rx_sdi[7] <= 191)
length -= 20;
else
length = ((191*5/4)-20) + ((rx_sdi[7]-191)*7/2);
}
sprintf(s, "Length estimated IN1 (BELDEN 1694A cables) : %dm \n",length);
Serial.println(s);
return 0;
}
The variable are always 0.
If I read the rate with this routine:
static int lmh0395_get_rate(void)
{
bool err;
uint8_t ctrl;
err = spi_sdi_read4(LMH0395_RATE_INDICATOR, &ctrl);
char s[25];
sprintf(s, "Rate IN4 : %s \n", (rx_sdi[1] & 0x20) ? "3G/HD" : "SD");
Serial.println(s);
sprintf(s, "Rate IN3 : %s \n", (rx_sdi[3] & 0x20) ? "3G/HD" : "SD");
Serial.println(s);
sprintf(s, "Rate IN2 : %s \n", (rx_sdi[5] & 0x20) ? "3G/HD" : "SD");
Serial.println(s);
sprintf(s, "Rate IN1 : %s \n", (rx_sdi[7] & 0x20) ? "3G/HD" : "SD");
Serial.println(s);
return 0;
}
I read all the right values.
I thinked that it was the equalized inputs so I switch all off but I return always 0.
Have you the software that it can explain how you make this routine?
Best regards,
Jonathan