SLAAEL6 September   2024 MSPM0G3507

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Hardware Setup
  6. 3Software Setup
  7. 4Software Structure
    1. 4.1 Flow Diagram
    2. 4.2 System Setup
    3. 4.3 Diagnostics
    4. 4.4 EEPROM Programming
  8. 5Summary
  9. 6References

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 are 16 different addresses. Therefore, the index runs from 0 to 15.

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

 Example of chip_status Without Errors
          for TPS929240-Q1 Figure 4-2 Example of chip_status Without Errors for TPS929240-Q1
 Example of chip_status With Errors for
          TPS929240-Q1 Figure 4-3 Example of chip_status With Errors for TPS929240-Q1

An example of when a low supply warning occurs (V(SUPPLY) < V(ADCLOWSUPTH)) in TPS929240-Q1 is depicted in Figure 4-4. The flag LOWSUP has been set for a 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 4804mV.

 Example of chip_status With Low Supply for TPS929240-Q1 Figure 4-4 Example of chip_status With Low Supply for TPS929240-Q1