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/TMS320F28377D: Double Pulse Generation

Part Number: TMS320F28377D
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hi, 

I am trying to produce a double pulse for the testing of a power device, the first pulse would be HI for a longer amount of time than the second pulse before returning to a LO signal for an extended period of time. This is outlined in the diagram below:

My thinking towards doing this was as follows:

-I can control the PWM and set its duty cycle however, I want to be able to interrupt the PWM after y and z so for the second period the duty cycle can be decreased to allow for the shorter z pulse.

-After this a second interrupt would need to be triggered to keep the PWM output at a LO signal. 

-I'm aware that each ePWM module has 4 CMPx's in the CC sub-module, with CMPA and CMPB currently being used to define the duty ratio of the PWM. This would allow me to use CMPC and CMPD, creating an action for the event trigger. I would accomplish this by making the CMPC = TBPRD which at that point (which in counts is equal to x and y) would flag an interrupt, and allow for the duty cycle to be changed to a lower one, creating the second pulse. CMPD would be equal in counts to  x + y + z  and this interrupt would hold the device from producing a PWM after the pulse a z,  until the reset on the launch pad was triggered. 

The questions I have are:

- is this scheme viable?

- are there any resources that may help me in learning how to go about implementing these interrupts? as I did not find the interrupt file from the C2000 examples helpful for my understanding.

I am new to using this micro-controller and any guidance to help me produce a solution on my own would be greatly appreciated. 

Thank you! 

  • Hi,

    This can be achieved in many ways. 
    Regarding interrupts, you can refer to Event Trigger Sub-Module chapter of the TRM.
    Figure 15-45. Event-Trigger Interrupt Generator
    You can use a single compare event (ex: CMPA) set the the duty cycle.
    You can use the transition causing the falling edge of Y (ex: CMPA match) to generate interrupt and change the value of CMPA to Z on the first interrupt.
    WHen the interrupt occurs again -  falling edge of Z - CMPA match, you can force the Trip zone signal and force PWM output to low.
    This will make the PWM to remain low until you clear it via s/w or device reset.
    Refer to 15.15.2.55 TZFRC Register, and enable a One-shot event in TZSEL Register and force the same via TZFRC reg in interrupt service routine.

  • Thank you, this has explained the theory behind the program well for me, however I am not really sure how to implement this as code. Can you suggest any resources for learning how I would code this?

    Thank you 

  • Hi,

    Please go through the basic epwm examples provided under
    C:\ti\c2000\C2000Ware_2_00_00_02\driverlib\f2837xd\examples\cpu1\epwm
    These should give you sufficient understanding to implement what you need.