SLVAFT2B May 2024 – April 2025 TPS2HCS10-Q1
The low-power mode example shows how to set the HCS high-side switch into low-power mode and then wake up on a fault event. To use this example, before downloading the code to the microcontroller set a load on channel 1 that consumes less that 800mA of current (what the LPM exit current is set to using HCS_gotoSleep). Once the code example has been downloaded, increase the load current to greater than 800mA. This can cause the LPM to exit, the FAULT pin to trigger, and for the microcontroller to interrupt or handle the event. The relevant application code can be seen below:
while(1)
{
/* Putting the device into LPM. 800mA exit current on CH1 */
HCS_gotoLPM(man_lpm_exit_curr_ch1_en_800mA_mask,
man_lpm_exit_curr_ch2_en_800mA_mask,
0);
/* Wait for the fault line to trigger low on PB3 */
__WFI();
/* If waking up from the interrupt, then check to make sure a signal was
for an LPM wakeup. The idea here is that the user increases the
load current somehow to "force the device" from LPM. */
resCode = HCS_readRegister(TPS2HCSXX_FLT_STAT_CH1_REG,
¤tValue);
resCode.byte |= HCS_readRegister(TPS2HCSXX_FLT_STAT_CH1_REG,
¤tValue).byte;
if(currentValue & TPS2HCSXX_FLT_STAT_CH1_LPM_WAKE_CH1_MASK)
{
/* Set a breakpoint here for demonstration */
asm ("nop");
}
}