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.

TMS320F28335: Double pulse generation with given PRI.

Part Number: TMS320F28335

I need to drive three phase six pulse rectifier with double pulse. I need to generate interrupt based on Zero crossing input and my PRI will be 20mSec.

Within 20mSec. We need to generate  two pulses (PW1 and PW2) with controlling the delay from PW1 + PW2 with respect to zero cross. I mean the position of PW1 and PW2 also not fixed and need to be 

varies according to my voltage input. 

Is there any way we can generate the two pulses within one PRI without CPU intervention ?

Above the is the reference PWM output requirement with TMS320F28335. 

  • Hi Ysn,

    I don't think there is any direct way to configure the ePWM compares + counts to generate two arbitrary pulses in a period.

    Instead, I think you'll need to move in new compare values with an ISR or DMA. The primary ePWM registers are shadowed, so you can move in new values and have them take effect at the start of the next ePWM counting period, so you have a pretty wide amount of time to get in and update the values.

    20mS = 3M cycles at 150MHz, so I think you'll have plenty of time to get in-and-out of the ePWM ISRs for 6 ePWMs maybe 3-4 times in that period?
  • It is also worth noting that newer device like F2837xS/D family have (1) more ePWM channels and (2) a x-bar system that I believe allows you to internally OR two ePWMs together which would allow you to implement what you want with minimal CPU intervention.
  • Thanks Devin,

    Yeah, in way i have aslo decided to use external PLD to OR the PWM1A and PWM1B for generating two PW with in PRI. But i need to generate a pulse in PWM1A with delay of 1.65mSec from zero cross, and another pulse in PWM1B with delay of 5mSec. then i can OR them to get the two pulse width out of OR gate. 

    Is it possible to control the individual delay of PWM1A and 1B. or is there any other way of doing. 

  • Also, can you help understand how to generate mono pulse with ePWM. Because i need to reset the timing with every 20 mSec with out actually continuous mode PWM.
  • Hi Ysn,

    Each ePWM time base has a common counter that is shared between PWM channels A and B. The modules also have two compares, A and B, that fire when they match the count.

    If you want to do arbitrary placement in the 20ms period and want to also control the width I think you'll need to use both compare A and B. This means you will get a single pulse per ePWM module.

    e.g. if you want 20mS period with 150MHz/64 = 2.3MHz ePWM clock, then ePWM period = 46875 in up-count mode. If the rising edge of the pulse is supposed to start at 1.65ms, then compare A = 3867 and action on compare A = ePWMA --> High. If the pulse is supposed to end after another 0.55ms then compare B = 5156 and action on compare B = ePWMA --> Low.

    If you want to do a single pulse (not repeating), setup the ePWM using an immediate load to the active registers, then setup the shadow registers such that at the end of the period the new values will be loaded resulting in no pin toggles.