This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] LP5810:"LED 开路检测""LED 短路检测"不能工作

Guru**** 2439710 points
Other Parts Discussed in Thread: LP5810

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/1448369/lp5810-led-open-detection-and-led-short-detection-doesn-t-work

器件型号:LP5810

工具与软件:

您好!

我想使用一个连接到 I2C 的 LP5810A...D、 我使用广播地址。

我在连接到 Arduino Pro Micro 的 Arduino 中使用以下初始化代码:

无 PWM (0xFF)、调整 DC_Current   

#define LP8510_Broadcast  0x1B
#define LP8510A           0x14
#define LP8510B           0x15
#define LP8510C           0x16
#define LP8510D           0x17

uint8_t LP8510_write(uint8_t chip_address, uint16_t register_address,uint8_t data)
{
  uint8_t chip_address_dummy=0, register_address_dummy_8=0;
  uint16_t register_address_dummy_16=0;

  chip_address=chip_address << 2;
  chip_address=chip_address&0x7F;
  
  register_address_dummy_16=register_address&0x3FF;
  register_address_dummy_8=register_address_dummy_16 >> 8;  
    
  chip_address_dummy=chip_address+register_address_dummy_8;
  
  register_address_dummy_8=register_address&0xFF;
  
  Wire.beginTransmission(chip_address_dummy);
  Wire.write(register_address_dummy_8); 
  Wire.write(data); 
  return(Wire.endTransmission(true));  
}

uint8_t LP8510_init(uint8_t chip_address)
{
  uint8_t error=0;

  error+=LP8510_write(chip_address, 0x000, 0x01);//Enable the internal circuits; 0h = Disable; 1h = Enable
  error+=LP8510_write(chip_address, 0x023, 0x66);//Software reset; Write 66h to reset
  delay(2); 
  error+=LP8510_write(chip_address, 0x000, 0x01);//Enable the internal circuits; 0h = Disable; 1h = Enable
  error+=LP8510_write(chip_address, 0x001, 0x00);//Max output current setting; 0h = 25.5mA; 1h = 51mA
  error+=LP8510_write(chip_address, 0x002, 0x00);//PWM dimming frequency setting; 0h = 24kHz; 1h = 12kHz              LED mode configuration; 0h = Direct drive mode;
  error+=LP8510_write(chip_address, 0x004, 0x00);//LED 0-3 autonomous control enable; 0h = Disabled, LED in manual mode; 1h = Enabled, LED in autonomous mode
  error+=LP8510_write(chip_address, 0x006, 0x00);//LED 0-3 exponential dimming enable; 0h = Disabled, LED PWM dimming with linear curve; 1h = Enabled, LED PWM dimming with exponential curve
  error+=LP8510_write(chip_address, 0x008, 0x00);//LED 0-3 PWM phase align method; 0h = Forward align; 1h = Forward align; 2h = Middle align; 3h = Backward align
  error+=LP8510_write(chip_address, 0x00C, 0x00);//Vsync used as output to export internal oscilator clock; 0h = Vsync is input; 1h = Vsync is output          Line change time; 0h = 1us; 1h = 1.3us; 2h = 1.7us; 3h = 2us
  
  error+=LP8510_write(chip_address, 0x00D, 0x13);
  /*Clamp voltage selection; 0h = VOUT-1.1V; 1h = VOUT-1.3V; 2h = VOUT-1.5V; 3h = VOUT-1.7V
  Clamp behavior selection; 0h = Clamp the OUTs only during line change time; 1h = Clamp the OUTs once current sink turns off
  Clamp behavior disable; 0h = Enale clamp; 1h = Disable clamp
  Action when LED open fault happens; 0h = No action; 1h = Shutdown current sink
  Action when LED short fault happens; 0h = No action; 1h = All OUTs shut down
  LSD threshold; 0h = 0.35 * VOUT; 1h = 0.45 * VOUT; 2h = 0.55 * VOUT; 3h = 0.65 * VOUT*/

  error+=LP8510_write(chip_address, 0x010, 0x55);//Configuration update command: registers 001h to 00Bh will ONLY be effective by sending this command; Write 55h to send this command
  error+=LP8510_write(chip_address, 0x020, 0x0F);//LED 0-3 Enable; 0h = Disabled; 1h = Enabled

  error+=LP8510_write(chip_address, 0x022, 0x07);
  /*TSD Fault Status Clear; Write 1 to clear and read back 0
  LSD Fault Status Clear; Write 1 to clear and read back 0
  LOD Fault Status Clear; Write 1 to clear and read back 0*/

  error+=LP8510_write(chip_address, 0x030, 0x01);// LED current
  error+=LP8510_write(chip_address, 0x031, 0x01);
  error+=LP8510_write(chip_address, 0x032, 0x01);
  error+=LP8510_write(chip_address, 0x033, 0x01);

  error+=LP8510_write(chip_address, 0x040, 0xFF);// PWM 100%
  error+=LP8510_write(chip_address, 0x041, 0xFF);
  error+=LP8510_write(chip_address, 0x042, 0xFF);
  error+=LP8510_write(chip_address, 0x043, 0xFF);

  return(error);  
}

通过此 INIT、我可以修改 DC_CURRENT。

uint8_t LP8510_set_current(uint8_t chip_address, uint8_t current_LED_0, uint8_t current_LED_1, uint8_t current_LED_2, uint8_t current_LED_3)
{
  uint8_t error=0;

  error+=LP8510_write(chip_address, 0x030, current_LED_0);
  error+=LP8510_write(chip_address, 0x031, current_LED_1);
  error+=LP8510_write(chip_address, 0x032, current_LED_2);
  error+=LP8510_write(chip_address, 0x033, current_LED_3);

  return(error);  
}

uint8_t LP8510_set_pwm(uint8_t chip_address, uint8_t pwm_LED_0, uint8_t pwm_LED_1, uint8_t pwm_LED_2, uint8_t pwm_LED_3)
{
  uint8_t error=0;

  error+=LP8510_write(chip_address, 0x040, pwm_LED_0);
  error+=LP8510_write(chip_address, 0x041, pwm_LED_1);
  error+=LP8510_write(chip_address, 0x042, pwm_LED_2);
  error+=LP8510_write(chip_address, 0x043, pwm_LED_3);

  return(error);  
}

void setup() 
{
  Wire.begin();

  Serial.begin(9600);
  while (!Serial);
  Serial.println("\nSerial activated");

  Serial.println(LP8510_init(LP8510_Broadcast));
  Serial.println(LP8510_set_current(LP8510_Broadcast,0x10,0x20,0x30,0x40));
  Serial.println(LP8510_set_pwm(LP8510_Broadcast,0xFF,0xFF,0xFF,0xFF));
}
  

LED 为0x10...0x40亮。

使用以下代码、I 读取寄存器0x300、0x301、0x303的值:

uint8_t LP8510_read(uint8_t chip_address, uint16_t register_address,uint8_t* data)
{
  uint8_t chip_address_dummy=0, register_address_dummy_8=0;
  uint16_t register_address_dummy_16=0;

  chip_address=chip_address << 2;
  chip_address=chip_address&0x7F;
  
  register_address_dummy_16=register_address&0x3FF; 
  register_address_dummy_8=register_address_dummy_16 >> 8;  
  
  chip_address_dummy=chip_address+register_address_dummy_8;

  register_address_dummy_8=register_address&0xFF;

  Wire.beginTransmission(chip_address_dummy);
  Wire.write(register_address_dummy_8); 
  Wire.endTransmission( false );
  Wire.requestFrom(chip_address_dummy, 1, true );          // Tell slave we need to read 1byte from the current register
  if ( Wire.available() >= 1 )
  {
    *data = Wire.read();        // read that byte into 'slaveByte2' variable
  }
  return(Wire.endTransmission(true));  
}


void loop() 
{
  uint8_t dummy=0;
  Serial.print(LP8510_read(LP8510_Broadcast, 0x300, &dummy));
  Serial.print(" # ");
  Serial.print(dummy);
  Serial.print(" # ");
  Serial.print(LP8510_read(LP8510_Broadcast, 0x301, &dummy));
  Serial.print(" # ");
  Serial.print(dummy);
  Serial.print(" # ");
  Serial.print(LP8510_read(LP8510_Broadcast, 0x303, &dummy));
  Serial.print(" # ");
  Serial.println(dummy);
  delay(1000); 
}

问题如下:

我可以短路或断开 LED、而不会更改"LED 开路检测"和"LED 短路检测"。

问题在哪里????

PWM 必须超过25、但它可以超过255? 无文档

谢谢!

此致

哈拉尔德

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    大家好、Harald、

    您的附加代码似乎没有问题。

    当您将 LED 短路或断开时、您可以帮助探测输出端的电压吗? 谢谢!

    BR、Jared

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    我直接在 IC 引脚上测量输出:

    Vsupply=4、56V

    Imax=25、5mA

    PWM=0xFF

    DC_CURRENT=0x00...0xFF

    电压输出引脚至 GND (正常)@ LED 电流0、1mA:2032V

    电压输出 引脚至 GND (短路)@ LED 电流0、1mA:0001V

    电压输出 引脚至 GND (开路)@ LED 电流0、1mA:4、56V

    电压输出 引脚至 GND (正常)@ LED 电流25、5mA:1631V

    电压输出 引脚至 GND (短路)@ LED 电流25、5mA: 0001V

    电压输出 引脚至 GND (开路)@ LED 电流25、5mA: 4、56V

    未检测到短路或开路。  

    输出由 BAV99和铁氧体磁珠(WE-CBF 742792651)保护

    谢谢!

    此致

    哈拉尔德

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    大家好、Harald、

    实际上、我不明白你的短裤和你的开放性是什么意思。

    根据数据表中的定义、开路阈值应低于180mV、短路阈值应高于 VOUT。 由于 LED 短路、这意味着输出将直接连接到 VLED、为高电平。 但如果 LED 开路、输出将悬空、并且将处于非常低的状态。

    我不明白为什么你的现象是相反的? 您能帮助检查您的电路板吗?

    BR、Jared

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    你是对的、我通过索引犯了一个错误。

    必须满足以下条件:

    电压输出引脚至 GND (正常)@ LED 电流0、1mA:2032V

    电压输出 引脚至 GND (LED 开路)@ LED 电流0、1mA:0001V

    电压输出 引脚至 GND (LED 短路)@ LED 电流0、1mA:4、56V

    电压输出 引脚 至 GND (正常)@ LED 电流25、5mA:1631V

    电压输出 引脚至 GND (LED 开路)@ LED 电流25、5mA: 0001V

    电压输出 引脚至 GND (LED 短路)@ LED 电流25、5mA: 4、56V

     

    我可以通过一个芯片(LP5810B)不时地读取短路或开路错误标志。 但是、如数据表中所述、在解决开路或短路问题后、这些标志不会自动复位。 我必须通过以下代码对其进行重置:

    #define LP8510_Broadcast  0x1B
    #define LP8510A           0x14
    #define LP8510B           0x15
    #define LP8510C           0x16
    #define LP8510D           0x17
      
      uint8_t dummy=0;
      Serial.print(LP8510_read(LP8510B, 0x301, &dummy);
      if(dummy!=0)
      {
        LP8510_write(LP8510B, 0x022, 0x01);
      }
    
      LP8510_read(LP8510B, 0x303, &dummy);
      //Serial.print(LP8510_read(LP8510_Broadcast, 0x303, &dummy));
      if(dummy!=0)
      {
        LP8510_write(LP8510B, 0x022, 0x02);
      }
      

    当我尝试通过"LP8510_Broadcast"读取寄存器时、无法读取错误寄存器。 (始终为0作为响应)

    我只能 通过直接地址0x15读取 LP8510B。

    直接地址和广播地址是否不同?

    开路和短路错误寄存器是否自动复位? 或者数据表中是否有错误?

    此致  

    哈拉尔德

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    大家好、Harald、

    好的、我看到了。 您的意思是不能使用广播模式读回故障、但可以使用独立模式读回故障。

    实际上、无论出现 LOD 或 LSD 故障、我们都需要使用独立模式来读回故障、因为如果我们使用广播模式、来自器件的数据可能会发生冲突。 因为器件 A 可能存在此故障、但器件 B 没有此故障。 来自 A 器件和 B 器件的数据可能会发生冲突。 我们需要使用独立模式来读回数据。

    BTW、故障不会自动复位、它需要发送如下所示的故障清除命令。

    BR、Jared

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    1) 1)我们只有一个连接到 I2C 总线的 LP5810器件、但我们希望其尽量灵活、因为"A"很难购买。

    因此不应发生冲突、因为只有一个 LP5810X。 但看起来直接和广播之间存在行为差异。

    2)包含的内容为:

    当我读取第二个蓝色句子时、我希望在解决开路问题时、该标志会自动清除。  

    对于短路问题、也是如此:

    此致

    哈拉尔德  

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    大家好、Harald、

    很抱歉给您带来不便。 要再次确认、请给我一些时间与我的团队核实、稍后我会再与您联系。

    BR、Jared

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您何时发布解决方案?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    大家好、Harald、

    很抱歉错过了。

    我已经在 EVM 上验证了它。 我们可以使用广播模式来读回 LOD 和 LSD 故障。 但如果是级联应用。 来自2个或更多器件的消息。 数据会发生冲突。 因此、我们不建议使用广播来读回故障信息。

    BR、Jared