SNVU854 april   2023 TPS929120-Q1 , TPS929121-Q1 , TPS929160-Q1 , TPS929240-Q1

 

  1.   Abstract
  2.   Trademarks
  3. 1Introduction
  4. 2Software Setup
  5. 3Hardware Setup
  6. 4Sample Code Structure
    1. 4.1 Flow Diagram
    2. 4.2 System Setup
    3. 4.3 Diagnostics
    4. 4.4 EEPROM Programming

Diagnostics

The sample code provides an API to detect which devices have faults such as open, short, or single-LED-short. Within the TPS929xxx_APIs.h file the prototype of the API is defined.

void LED_Update_Chip_Status(unsigned int dev_addr_x);

This API updates the variable chip_status which is defined in system_info.h. For devices TPS929160-Q1 and TPS929240-Q1, there is an additional power pin called VBAT. Therefore, the variable includes a measured voltage result for this pin for those devices. In addition, these devices include an additional fault type called Supply Undervoltage. Therefore, these devices include flag SUPUV.

struct chipStatus {
    // Indicates open, short, and/or single-LED-short fault
    uint16_t OUT_flag;                          
    uint16_t SHORT_channels[MAX_CHANNEL_CNT];
    uint16_t OPEN_channels[MAX_CHANNEL_CNT];
    uint16_t SLS_channels[MAX_CHANNEL_CNT];     // Single-LED-short
    uint16_t EEPCRC;                            // EEPROM CRC fault
    uint16_t TSD;                               // Thermal Shutdown
    uint16_t PRETSD;                            // Pre-thermal shutdown warning
    uint16_t REF;                               // REF-pin fault
    uint16_t LOWSUP;                            // Low supply
    uint16_t POR;                               // Power-on-reset
#ifndef TPS92912X
    uint16_t SUPUV;                             // Supply undervoltage
    uint16_t VBAT_mV;        // *1 mV
#endif
    uint16_t VSUPPLY_mV;     // *1 mV
    uint16_t VLDO_mV;        // *1 mV
    uint16_t TEMPSNS_10mC;   // *10 mC
    uint16_t VREF_100uV;     // *100 uV
    uint16_t IREF_10nA;      // *10 nA
};

// For diagnostics
extern struct chipStatus chip_status[];

The variable chip_status can be watched in the Expressions view during the debug of the code by following the steps in Watching Variables, Expressions, and Registers. An example without any error is depicted in Figure 4-2. The first index of variable chip_status is the address of the LED driver on the FlexWire bus. In total there could be 16 different addresses. Therefore, the index runs from 0 to 15.

GUID-20230322-SS0I-2Z2V-MBCD-RQ8JK3SXLDDK-low.jpg Figure 4-2 Example of Watching Expression chip_status Without Errors for TPS929120-Q1

An example with a short is depicted in Figure 4-3. The TPS929120-Q1 has address 0x1 and flag OUT_Flag is set. When the array SHORT_channels is expanded, it can be seen that the short occurs on pin OUT2.

GUID-20230322-SS0I-NHZG-SZTR-4NVG24TBJDHG-low.jpg Figure 4-3 Example of Watching Expression chip_status with Short Fault for TPS929120-Q1

An example when a low supply warning occurs (V(SUPPLY) < V(ADCLOWSUPTH)) in TPS929120-Q1 is depicted in Figure 4-4. The flag LOWSUP has been set for device with address 0x1. In addition, for this warning the supply voltage is measured by the ADC and reported in the diagnostics as well. The measured result in this example is 6627 mV.

GUID-20230322-SS0I-7FZL-JRRZ-N5SRL7NTCZT8-low.jpg Figure 4-4 Example of Watching Expression chip_status With Low Supply for TPS929120-Q1