SLVAFT2A May 2024 – July 2024 TPS2HCS10-Q1
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:
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);
}