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/TMS320F28035: comparator example code

Part Number: TMS320F28035
Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE

Tool/software: Code Composer Studio

Hi TI experts,

I plan to use the comparator module to limit the a current cycle by cycle. I assume the way to do it is to use comparator to compare the ADC and an internal value, and as long as the ADC is higher, an internal TZ is generated to limit the current.

However, after reading the manual, I did not find any code examples. Do you have any example code, either from ControlSuite or C2000Ware, from which I could learn from?

Thanks,

Ivan

  • Hi Ivan,

    Your thought is correct.

    The "epwm_dcevent_trip_comp" example should be a decent starting point.  Within C2000Ware, this can be found at the below location:
    \C2000Ware_X_XX_XX_XX\device_support\f2803x\examples\c28\epwm_dcevent_trip_comp\

    This example uses ePWM1 along with Comparator1 with One-Shot Trip mode. 
    By default, it uses the difference between COMP1A & COMP1B.  However, two lines can be uncommented to instead use the internal DAC as the negative input to the comparator.

    Hopefully this helps!


    Thank you,
    Brett