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: something wrong with the CBC function

Part Number: TMS320F28035

Tool/software: Code Composer Studio

hear is the source code of the CBC function,when i test it, the output of pwmxa is forced to low and then output high after one pwm cycle. but epwmxb is always low.Is there any wrong wit my  configureation?

EPwm1Regs.DCTRIPSEL.bit.DCAHCOMPSEL = DC_COMP1OUT; // DCAH = Comparator 1 output
EPwm2Regs.DCTRIPSEL.bit.DCAHCOMPSEL = DC_COMP1OUT; // DCAH = Comparator 1 output

EPwm1Regs.TZDCSEL.bit.DCAEVT2 = TZ_DCBH_HI; // DCAEVT1 = DCAH high(will become active
EPwm2Regs.TZDCSEL.bit.DCAEVT2 = TZ_DCBH_HI; // DCAEVT1 = DCAH high(will become active
// as Comparator output goes high)
EPwm1Regs.DCACTL.bit.EVT2SRCSEL = DC_EVT2; // DCAEVT1 = DCAEVT1 (not filtered)
EPwm1Regs.DCACTL.bit.EVT2FRCSYNCSEL = DC_EVT_ASYNC; // Take async path
EPwm2Regs.DCACTL.bit.EVT2SRCSEL = DC_EVT2; // DCAEVT1 = DCAEVT1 (not filtered)
EPwm2Regs.DCACTL.bit.EVT2FRCSYNCSEL = DC_EVT_ASYNC; // Take async path

// DCxEVT2 events can be defined as cycle-by-cycle.
EPwm1Regs.TZSEL.bit.DCAEVT2 = 1;
EPwm2Regs.TZSEL.bit.DCAEVT2 = 1;

EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low
EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low
EPwm2Regs.TZCTL.bit.TZA = TZ_FORCE_LO; // EPWMxA will go low
EPwm2Regs.TZCTL.bit.TZB = TZ_FORCE_LO; // EPWMxB will go low

  • User5297681,

    can you please highlight the path you want to use on the following diagram. I belive you have configured the DCAEVT2 event to directly affect the PWM, when you intended to configure the DCAEVT2 to trip the CBC mechanism for the Trip-zone submodule.

    Regards,
    Cody

  • As shown in the figure below,the red line is the path I want,any wrong with my configuration?

  • I cannot see the image, sometimes its a file type issue, sometimes its the way you embedded the image. The "insert/Edit Media"  button usually works well for me. Please let me know if you cannot get it to upload.

    Regards,
    Cody 

  • I'm sorry for that,can you see the picture now? It's the path I want.

  • OK you are trying to use DCAEVT2 to trip the CBC mechanism. This can be done.

    First of all it looks like you have correctly set DCAEVT2 up in the TZSEL register.

    Since you are wanting to use the CBC mechanism you will need to configure TZCTL.TZA and TZCTL.TZB to the action you want.

    You do not want to use DCBEVT1, DCBEVT2, DCAEVT1, or DCAEVT2 to trip the PWM directly, so please set those events to the " do nothing" option in the TZCTL register.

    I think that should correct the issue you are having. Please let me know.

    Regards,
    Cody 

  • thank you for your help!