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.

TMS320F28055: in TMS320F28055 i had configure PWM4, but interrupt is not generating

Part Number: TMS320F28055
Other Parts Discussed in Thread: CONTROLSUITE

hello sir,

i had configured PWM 4 to generate interrupt at fixed interval, i am getting interrupt flag, but control is not going into ISR. Here is below my settings.

please let me know if i am missing any settings.

EALLOW;
SysCtrlRegs.PCLKCR1.bit.EPWM6ENCLK = 1; // ePWM7
// Setup TBCLK
EPwm6Regs.TBPRD = 3000; // Set timer period 3000 TBCLKs
EPwm6Regs.TBPHS.half.TBPHS = 0x0000; // Phase is 0
EPwm6Regs.TBCTR = 0x0000; // Clear counter
// Setup counter mode
EPwm6Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Count up
EPwm6Regs.TBCTL.bit.PHSEN = TB_DISABLE; // Disable phase loading
EPwm6Regs.TBCTL.bit.HSPCLKDIV = TB_DIV1; // Clock ratio to SYSCLKOUT
EPwm6Regs.TBCTL.bit.CLKDIV = TB_DIV1;
EPwm6Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO;
// interrupt enable
EPwm6Regs.ETSEL.bit.INTEN = 1; //
EPwm6Regs.ETSEL.bit.INTSEL = ET_CTR_PRD; // Select Int from counter = PRD
EPwm6Regs.ETPS.bit.INTPRD = ET_1ST; // Generate pulse on 1st event

PieVectTable.EPWM6_INT = &timer50us_isr;
IER |= M_INT3; // Enable CPU INT3 for capture interrupt
PieCtrlRegs.PIEIER3.bit.INTx6 = 1; // Enable EPWM7 int in PIE group 3
SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 1; // Stop all the TB clocks
EDIS;

thanks 

yogesh

  • sorry, i had check with pwm 4 and pwm 6 also. here i attached code for PWM 6. For both PWM i am getting same results.
  • here is my ISR routine,
    interrupt void timer50us_isr(void)
    {
    while(1);
    EPwm6Regs.ETCLR.bit.INT = 1;

    PieCtrlRegs.PIEACK.all = PIEACK_GROUP3;
    }

    control is not coming till here.
  • Did you enable global interrupt

    // Enable global Interrupts and higher priority real-time debug events:
    EINT; // Enable Global interrupt INTM
    ERTM; // Enable Global realtime interrupt DBGM

    Btw, there are examples available at
    C:\ti\controlSUITE\device_support\f2805x\v104\F2805x_examples_ccsv5\epwm_timer_interrupts

    Hope this will help resolve.

    I am closing this thread right now. If the issue is not resolved, you can reply back and the thread will reopen if within 30 days.
  • yes i had made globle interrupt enabled. then also i am not getting interrupt. 

  • Hi,

    I was responding to a somewhat similar post with interrupt generation issues.
    e2e.ti.com/.../2584970
    Can you check the following?

    1. Is the module generating interrupt?
    Please check the ETFLG register of the corresponding EPWM is set. If it's already set, clear it and make sure that it's set at the intended time.
    If this step is not working, that means some wrong configuration of module or interrupt.
    2. Once the Interrupt is generated from the module, it is transferred to pie. Check IER/ACK etc
    3. CPU executing ISR - Is it executing some random/uninitialized code? If so, it would be appropriate to check the PieVector table ISR address.

    It would be also good to disable all other interrupts in the system and enable only this interrupt for debug purposes.