SLVAFT2A May   2024  – July 2024 TPS2HCS10-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Software Ecosystem
  5. 2Platform Drivers
    1. 2.1 Driver Concept
    2. 2.2 Supported Platforms
    3. 2.3 Porting to Other Platforms
    4. 2.4 API Guide
      1. 2.4.1  tHCSResponseCode Union Reference
      2. 2.4.2  float_t HCS_convertCurrent (uint16_t rawValue, uint16_t ksnsVal, uint16_t snsRes)
      3. 2.4.3  float_t HCS_convertTemperature (uint16_t rawValue)
      4. 2.4.4  float_t HCS_convertVoltage (uint16_t rawValue)
      5. 2.4.5  tHCSResponseCode HCS_getChannelFaultStatus (uint8_t chanNum, uint16_t * fltStatus)
      6. 2.4.6  tHCSResponseCode HCS_getDeviceFaultSatus (uint16_t * fltStatus)
      7. 2.4.7  tHCSResponseCode HCS_gotoLPM (lpm_exit_curr_ch1_t ch1ExitCurrent, lpm_exit_curr_ch2_t ch2ExitCurrent)
      8. 2.4.8  tHCSResponseCode HCS_gotoSleep (void )
      9. 2.4.9  tHCSResponseCode HCS_initializeDevice (TPS2HCS10Q1_CONFIG * config)
      10. 2.4.10 tHCSResponseCode HCS_readRegister (uint8_t addr, uint16_t * readValue)
      11. 2.4.11 tHCSResponseCode HCS_setSwitchState (uint8_t swState)
      12. 2.4.12 tHCSResponseCode HCS_updateConfig (TPS2HCS10Q1_CONFIG * config)
      13. 2.4.13 tHCSResponseCode HCS_wakeupDevice (void )
      14. 2.4.14 tHCSResponseCode HCS_writeRegister (uint8_t addr, uint16_t payload)
  6. 3Configuration or Evaluation Tool
  7. 4Code Examples
    1. 4.1 Empty Example
    2. 4.2 I2T Trip Example
    3. 4.3 Low-Power Mode Example
    4. 4.4 Current Sense Example
  8. 5Summary
  9. 6References
  10. 7Revision History

I2T Trip Example

The I2T trip code examples shows how to handle an event on the high-side switch when an I2T event happens in the system. This code example assumes that the device is setup to LATCH mode for I2T faults and shows the correct sequence of events to reset the device after the I2T event occurs. In auto-retry mode (where TCLDN_CHx of the I2T_CONFIG_CHx register are set to a timeout), the device automatically waits the appropriate duration of time before re-enabling the channel.

Note, that in this code example the FAULT pin is setup to be used as a falling edge interrupt. When the I2T trip occurs, the FAULT pin (which is open drain) is pulled low and the microcontroller is interrupted. The software on the microcontroller can then wake up device execution and take the necessary mitigations to re-enable the device. In LATCH mode, the appropriate steps to take after the I2T trip event occurs is to:

  1. Disable the affected channel
  2. Set the TCLDN_CHx of the I2T_CONFIG_CHx register to an appropriate cool-down time
  3. Wait the specified duration by sleeping on the microcontroller
  4. Set the TCLDN_CHx of the I2T_CONFIG_CHx register back to LATCH mode
  5. Re-enable the channel

The following is a relevant snippet of code:

        if(currentValue & TPS2HC10S_FLT_STAT_CH1_I2T_FLT_CH1_MASK)
        {
            /* Disabling the channel */
            HCS_setSwitchState(0);

            /* Setting the device to 2s retry state */
            exportConfig.i2tConfigCh1.value.bits.TCLDN_CH1 =
                (tcldn_ch1_en_3_0x2 >> TPS2HC10S_I2T_CONFIG_CH1_TCLDN_CH1_OFS);
           HCS_writeRegister(TPS2HC10S_I2T_CONFIG_CH1_REG,
                        exportConfig.i2tConfigCh1.value.word);

            /* Waiting for two seconds. At this point we can normally 
                yield the tasks if we were in an RTOS, but just waiting for
                an interrupt here.  */

            DL_TimerA_startCounter(TIMER_0_INST);
            while(timerTriggered == false)
            {
                __WFI();
            }
            timerTriggered = false;

            /* Setting back to latch mode */
            exportConfig.i2tConfigCh1.value.bits.TCLDN_CH1 = 0;
           HCS_writeRegister(TPS2HC10S_I2T_CONFIG_CH1_REG,
                        exportConfig.i2tConfigCh1.value.word);

            /* Re-enabling the channel */
            HCS_setSwitchState(1);
        }