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/tms320f28379d: ISR_settings in TMS320F28379D

Part Number: TMS320F28379D


Tool/software: Code Composer Studio

hello

i am working for DC-DC converter applications

now i am doing programming for my controller to give 20Khz PWM for my converter switching.

so here i got some examples about ePWM....but i need to set the ISR-(interrupt service routine) for my application.

how can i set the ISR for 20Khz...

please some one help me.........

  • Hello,

    You will want to use the Event Trigger submodule of the EPWM. Specifically, look at the ETSEL[INTSEL] and ETSEL[INTEN] bits. You can find details in the TRM (linked to below).

    Regards,

    Kris

  • Thank you Kris

    can i get some example code with explanation.....

     

  • sorry for delay
    thank you
    hello Kris
    i am not using event triggering, i m generating sine_PWM(PWM with respect to sine wave )
    but i need to know how much time my isr code is running in this application.
    what is the resolution of my program?
    this is my isr:
    __interrupt void epwm1_isr(void)
    {
    a=sin(PI*0.02*i);
    GpioDataRegs.GPBDAT.bit.GPIO52 = 1;
    if (a>=0)
    {
    EPwm1Regs.CMPA.bit.CMPA =b[i];
    EPwm1Regs.CMPB.bit.CMPB =b[i];
    EPwm2Regs.CMPA.bit.CMPA =b[i];
    EPwm2Regs.CMPB.bit.CMPB =b[i];
    EPwm3Regs.CMPA.bit.CMPA =b[i];
    EPwm3Regs.CMPB.bit.CMPB =b[i];
    EPwm4Regs.CMPA.bit.CMPA =b[i];
    EPwm4Regs.CMPB.bit.CMPB =b[i];
    EPwm5Regs.CMPA.bit.CMPA =b[i];
    EPwm5Regs.CMPB.bit.CMPB =b[i];
    EPwm6Regs.CMPA.bit.CMPA =b[i];
    EPwm6Regs.CMPB.bit.CMPB =b[i];
    }
    else
    {
    EPwm1Regs.CMPA.bit.CMPA =b[i];
    EPwm1Regs.CMPB.bit.CMPB =b[i];
    EPwm2Regs.CMPA.bit.CMPA =b[i];
    EPwm2Regs.CMPB.bit.CMPB =b[i];
    EPwm3Regs.CMPA.bit.CMPA =b[i];
    EPwm3Regs.CMPB.bit.CMPB =b[i];
    EPwm4Regs.CMPA.bit.CMPA =b[i];
    EPwm4Regs.CMPB.bit.CMPB =b[i];
    EPwm5Regs.CMPA.bit.CMPA =b[i];
    EPwm5Regs.CMPB.bit.CMPB =b[i];
    EPwm6Regs.CMPA.bit.CMPA =b[i];
    EPwm6Regs.CMPB.bit.CMPB =b[i];
    }
    GpioDataRegs.GPBDAT.bit.GPIO52 = 0;
    i++;
    if (i==401)
    {
    i=0;
    }
    }
    by using i/o:GPIO52 i want measure the time...that means ..when my isr_ started it will ON,when it is get out of the loop it will go back to OFF...
    means it will generates the pulse....that pulse width is my time..