SLVAFT2B May   2024  – April 2025 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 (tps2hcsxx_man_lpm_exit_curr_ch1_mask_t ch1ExitCurrent, tps2hcsxx_man_lpm_exit_curr_ch2_mask_t ch2ExitCurrent, uint16_t existingValue)
      8. 2.4.8  tHCSResponseCode HCS_gotoSleep (void )
      9. 2.4.9  tHCSResponseCode HCS_initializeDevice (TPS2HCSXXQ1_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

Low-Power Mode Example

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,
                                    &currentValue);
        resCode.byte |=  HCS_readRegister(TPS2HCSXX_FLT_STAT_CH1_REG,
                                    &currentValue).byte;

        if(currentValue & TPS2HCSXX_FLT_STAT_CH1_LPM_WAKE_CH1_MASK)
        {
            /* Set a breakpoint here for demonstration */
            asm ("nop");
        }
    }