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.

Different PWM techniques using Piccolo



Hello,

I am new to this site and also new to using MCUs. I've just got a Piccolo F28127 and want to experiment producing

the different PWM techniques for a simple basic inverter. The different PWM techniques that I want to realize are

1) Single PWM

2) Multiple PWM

3) Sinusoidal PWM

(Now I am successful with these I would also like to experiment using Modified Sinusoidal PWM, Trapezoidal, Staircase and Delta Modulation).

 

Using the ePWM module and the basic submodules therein (Time Base, Counter Compare and Action Qualifier) I was able to realize

Single PWM easily. But I am stuck with how to use Multiple PWM. I tried putting the code into the while loop in the main function, but somehow

I feel that it is wrong. Many people use Interrupt Service Routines (ISR's) to accomplish the task (I got this when i read other discussions in the forums).

I'm new with using interrupts for the task (actually new to everything). Please guide me in using interrupts to accomplish the different PWM waveforms.

Any help would be highly appreciated. Thank you in advance.

 

~ Elijah

  • Please help me guys... I'm stuck...

  • My example how to configure ePWM interrupts for 2809. Underflow of PWM counter causes interrupt.

    void PwmSetup(void)

    {

    ....

    /* generate event when counter is zero */
        EPwm1Regs.ETSEL.bit.INTSEL = ET_CTR_ZERO;

    /* generate interrupt on every event */
        EPwm1Regs.ETPS.bit.INTPRD = ET_1ST;

    /* enable interrupt */
        EPwm1Regs.ETSEL.bit.INTEN = 0x1;

    ....

    }

    void InterruptSetup(void)
    {
        IER = 0x0000;
        IFR = 0x0000;

    /* pointer to ISR function called DMC */
        EALLOW;
            PieVectTable.EPWM1_INT = &DMC;
        EDIS;

    /* enable interrupt in PIE */
        PieCtrlRegs.PIEIER3.bit.INTx1 = 0x1;

    /* enable interrupt in CPU */
        IER |= M_INT3;
    }

     

    void main(void)

    {

    ....

    /* */

    EnableInterrupts();

    ....

    }

     

    interrupt void DMC(void)

    {

    /* clear peripheral interrupt flag */

        EPwm1Regs.ETCLR.bit.INT = 1;

    /* clear flag in PIE */
        PieCtrlRegs.PIEACK.all = PIEACK_GROUP3;

    }