This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320F28034: How to generate an interrupt by Comparator (Comp2Reg) result?

Part Number: TMS320F28034
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hi.

I am using COMP2 as I-Short Circuit detector. I set the Comparator registers and it triggs properly. The only thing that I couldnt find is Comparator Interrupt. I need the chipset generate an interrupt when the Comparator status becomes =1.

Please show me the code and registers related. Thanks.

  • Hi Zeuge,

    The comparator itself doesn't have interrupt generation capability. However, the comparator output goes to the Digital Compare module of the EPWM so you can use the Trip Zone to generate an interrupt when the comparator trips. Please read through the Digital Compare and Trip Zone submodules of the EPWM chapter. We also have C2000Ware examples that should help you along. These 2 specific examples should be what you are looking for.

    C2000Ware_version\device_support\f2803x\examples\c28\epwm_dcevent_trip_comp

    C2000Ware_version\device_support\f2803x\examples\c28\epwm_trip_zone