Hi @Valeriy,
Thank you for your detailed question regarding overcurrent protection on the Delfino F28377S MCU using CMPSS and ePWM peripherals.
Based on your description, you have successfully set up the ADC to CMPSS path, confirmed via the `Cmpss1Regs.COMPSTS.COMPHSTS` register. The next step is to configure the ePWM module to shut down PWM generation immediately when any CMPSS comparator output signals an over-threshold condition and subsequently allow software to reset the PWM once the fault clears.
Recommendations for Your Configuration
1. CMPSS Comparator Setup The Comparator Subsystem (CMPSS) consists of two comparator modules (COMPH and COMPL) which generate digital outputs based on voltage thresholds applied either externally or internally via DACs. You are correctly monitoring these digital outputs for fault detection. This usage aligns with the “Using Comparator Subsystem (CMPSS) for Voltage Compare” example, where CMPSS outputs are used as trip signals to ePWM peripherals (refer to pp. 6-62 to 6-64).
2. ePWM Trip Zone Configuration for One-Shot Shutdown The ePWM module’s Trip Zone feature is designed to immediately shut down PWM outputs when a fault condition occurs, such as an overcurrent detected by CMPSS. You should configure the Trip Zone unit to monitor CMPSS outputs as digital trip inputs. This allows one-shot PWM shutdown upon fault detection, which remains latched until cleared by software. This configuration is detailed in the Trip Zone section, pp. 3-19, along with Digital Compare on pp. 3-29 of the User’s Guide. The overall ePWM submodules, including Time-Base and ActionQualifier, are on pp. 3-2 to 3-18 for reference.
3. Software Reset for PWM Restart After the fault clears (CMPSS output returns to normal), you need to clear the Trip Zone flags and reset the ePWM module in software to restart PWM generation. This is a common fault-handling pattern for TI C2000 devices.
4. Peripheral Timer Sharing Considerations Remember that ePWM and CMPSS peripherals can share underlying timer resources, which may require careful configuration to avoid conflicts (refer to the peripheral timer sharing notes in the guide).
Summary
- Use CMPSS digital outputs as trip signals for ePWM Trip Zone inputs.
- Configure ePWM Trip Zone for one-shot PWM shutdown on CMPSS trip (pp. 3-19).
- Use software to clear Trip Zone and restart PWM after fault clearance.
- Review ePWM submodules for comprehensive configuration (pp. 3-2 to 3-29).
References
- MathWorks, C2000 Microcontroller Blockset User’s Guide* provided by you
* Submodules of ePWM Type 1-4, pp. 3-2 * Time-Base, pp. 3-3 * Counter Compare, pp. 3-14 * ActionQualifier, pp. 3-18 * Trip Zone, pp. 3-19 * Digital Compare, pp. 3-29 * Using Comparator Subsystem (CMPSS) for Voltage Compare, pp. 6-62 to 6-64
Hope this helps.