ZHDU174B November 2024 – March 2026 TLC69627-Q1 , TLC69628-Q1 , TLC69629-Q1 , TLC69637-Q1 , TLC69638-Q1 , TLC69639-Q1
示例代码提供了一个 API 来检测哪些 LED 驱动器器件具有故障,例如热关断 (TSD)、LED 开路 (LOD)、LED 短路 (LSD) 和相邻引脚短路 (APS)。对于 LOD、LSD、LED_CHK、DRV_CHK 和 APS,还会检测故障通道。此外,当宏 USE_CONN_IC 设置为 _TRUE 时,将读取 UPAC 器件检测到的故障。TLC6962x_3x_APIs.h 文件中定义了该 API 的原型。
void LED_Update_Chip_Status(void);
该 API 会更新 chip_status 变量(此变量在 system_info.h 文件中定义)。
struct busStatus {
uint16_t chip_index; // Show Chip Index
uint16_t LOD; // LED Open Detection
uint16_t LSD; // LED Short Detection
uint16_t FB_OVF; // Device FB overflow flag
uint16_t COMM_ERR; // Device communication error flag including CRC, COMM_LOSS, CMD_ERR, TOUT_ERR, MEM_ERR
uint16_t UVLO; // Device UVLO flag
uint16_t TSD; // Thermal Shutdown
uint16_t PIN_ERR; // Device PIN error flag including APS, LED_CHK, DRV_CHK, ISET_O, ISET_S
uint16_t BIST; // Device BIST error flag including WDOG_BIST, TOUT_BIST, OTP_CRC
uint16_t DEV_MODE; // Device mode
uint16_t DEC; // Device FB decrease flag
uint16_t INC; // Device FB increase flag
uint16_t APS; // Device Adjacent Pin Short flag
uint16_t DRV_CHK; // Device DRV_CHK flag
uint16_t LED_CHK; // Device LED_CHK flag
uint16_t CRC; // Device CRC flag
uint16_t COMM_WDOG; // Device COMM_WDOG flag
uint16_t CMD_ERR; // Device CMD_ERR flag
uint16_t TOUT_ERR; // Device time-out error fla
uint16_t ISET_O; // Device ISET open flag
uint16_t ISET_S; // Device ISET short
uint16_t SRAM_CRC; // Device MEM_ERR flag
uint16_t OTP_CRC; // Device OTP CRC error flag
uint16_t WDOG_BIST; // Device watchdog BIST error flag
uint16_t TOUT_BIST; // Device time-out BIST error flag
volatile OUTx LSD_channels[MAX_SCAN_LINES];
volatile OUTx LOD_channels[MAX_SCAN_LINES];
volatile OUTx APS_channels[MAX_SCAN_LINES];
volatile OUTx DRV_CHK_channels[MAX_SCAN_LINES];
volatile OUTx LED_CHK_channels[MAX_SCAN_LINES];
};
struct chipStatus {
struct busStatus busStatus[MAX_CASCADED_UNITS];
#ifdef _TLC69698
uint16_t ERR; // Global error flag
uint16_t POR; // Power-On-Reset flag
uint16_t OTP_CRC; // OTP CRC error
uint16_t DEV_STATE; // Device state
uint16_t CTRL_IF_CRC; // SPI/UART CRC error
uint16_t CTRL_IF; // SPI/UART error
uint16_t CTRL_IF_TIMEOUT; // SPI/UART reset timeout error
uint16_t SPI_CS; // SPI Chip Select (CS) pin error
uint16_t UART_NE; // UART Noise Error
uint16_t UART_FE; // UART Frame Error
uint16_t UART_RST; // UART Reset
uint16_t CSI_IDLE; // CSI Peripheral in IDLE state
uint16_t FIFO; // FIFO error
uint16_t RXFFOVF; // Receive FIFO overflow
uint16_t TXFFOVF; // Transmit FIFO overflow
uint16_t DAISY_CHAIN; // LED driver error
uint16_t LOD; // Daisy Chain LOD flag
uint16_t LSD; // Daisy Chain LSD flag
uint16_t DRV_IF; // CSI interface error
uint16_t CSI_COMM_WDOG; // Device CSI communication watchdog flag
uint16_t CSI_TOUT_ERR; // Device CSI time-out error flag
uint16_t CSI_CMD_ERR; // Device CSI command error flag
uint16_t CSI_CRC; // Device CSI CRC flag.
uint16_t FLTSUM_ONGOING; // Fault summary cycle in progress flag.
uint16_t FLTSUM_DATAVALID; // Fault summary data valid flag.
uint16_t DEV_CNT_LOD_LSD; // Device count that have LOD and/or LSD.
uint16_t ZONE_CNT_LOD_LSD; // Total zone count that have LOD and/or LSD.
uint16_t SZ_CNT_LOD_LSD; // Total safety zones channel count that have LOD and/or LSD.
#endif
};
// For diagnostics
extern struct chipStatus chip_status[BUS_NUM];
在代码调试期间,可以按照观察变量、表达式和寄存器中的步骤在表达式视图中观察变量 chip_status。图 3-5 中描述了一个没有任何错误的示例。变量 chip_status 的第一个索引是菊花链索引。在 EVM 上只有一个链。对于 LED 驱动器的标志,使用 busStatus 变量,该变量具有链中每个 LED 驱动器的索引。在 TLC69628Q1EVM 和 TLC69698Q1EVM 上有 2 个级联的器件,因此 busStatus 索引的编号是从 0 到 1。对于 TLC69622Q1EVM 和 TLC69625Q1EVM,只有 1 个器件级联,因此 busStatus 只有索引 0。
图 3-5 观察表达式 chip_status(无错误)的示例
图 3-6 观察表达式 chip_status(无错误)的扩展示例图 3-6 显示了 chip_status 变量的扩展视图,对于菊花链中的两个 LED 驱动器,每一个都显示了芯片索引和故障状态位。此外,对于 LSD、LOD、LED_CHK、DRV_CHK 和 APS 故障,可以找到具有故障的实际输出通道。LOD 故障的示例如图 3-7 所示。在此示例中,芯片索引 1(即 busStatus 的索引 0)具有 LOD 故障。数组 LOD_channels 扩展后,会显示故障发生在引脚 OUT12 上。LOD_channels 是一个仅有 1 个索引的数组,因为对于 TLC6962x/TLC6963x-Q1 器件,只有 1 条扫描线。
图 3-7 具有 LED 开路 (LOD) 故障的 chip_status 示例当 LED 驱动器与 UPAC 器件配对使用时,chip_status 变量还会显示 UPAC 器件的错误标志。图 3-8 中描述了一个没有任何故障的示例,其中为每个菊花链(chip_status 的第一个索引)列出了错误标志。请注意,CSI_IDLE 为 1,因为在诊断期间,UPAC 器件不转发任何消息。FLTSUM_DATAVALID 为 1,因为示例代码中的诊断发生在 TLC69698-Q1 的故障汇总第一个周期之后。
图 3-8 与 TLC69698-Q1 配对使用时未出现错误的 chip_status 示例使用 UPAC 器件时发生 LOD 故障的示例如图 3-9 所示。在此示例中,TLC69698-Q1 中的 DAISY_CHAIN 和 LOD 标志均被置位。此外,TLC69698-Q1 的故障汇总功能统计出有 1 个器件存在故障 (DEV_CNT_LOD_LSD),并且有 1 个 LED 区域存在故障 (ZONE_CNT_LOD_LSD)。发生故障的 LED 区域未被识别为 LED 驱动器中的所谓安全区域。因此,SZ_CNT_LOD_LSD 仍为 0。
图 3-9 与 TLC69698-Q1 配对使用时具有 LOD 故障的 Expression chip_status 示例在图 3-10 所示的示例中,故障汇总统计出 2 个器件中有 3 个 LED 故障,其中所有 3 个 LED 区域都被指定为所谓的安全区域。当安全区域发生故障时,TLC69698-Q1 还会记录故障位置。这些位置可以在变量 fault_summary 中找到,如图 3-11 所示。最后一个有效条目之后的条目填充为 0xFFFF,以表示数组结束。这意味着,在此示例中,数组的索引 3 填充为 0xFFFF,因为索引 0 到 2 包含了发生故障的 LED 安全区域的有效位置。
图 3-10 与 TLC69698-Q1 配对使用时具有 3 个故障的表达式 chip_status 示例
图 3-11 与 TLC69698-Q1 配对使用时具有 3 个故障的表达式 fault_summary 示例