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.

TMS320F2800137: Regarding ECAP initialization

Part Number: TMS320F2800137
Other Parts Discussed in Thread: SYSCONFIG

I have taken GPIO40 as a input for calculating the time period of a pulse. First I initialize using XBAR input1select. I also configure ECAP1_ISR like 

InputXbarRegs.INPUT1SELECT=40; (Please check it)

EALLOW;
PieVectTable.ECAP1_INT= &eCAP1_isr;
EDIS;

PieCtrlRegs.PIEIER4.bit.INTx1 = 1; // Enable ECAP1_INT in PIE group 4
IER |= 0x0008;  

I also configure ECAP such as

Configure eCAP1 unit for capture
//---------------------------------------------------------------------
ECap1Regs.ECEINT.all = 0; // Disable all eCAP interrupts
ECap1Regs.ECCTL1.bit.CAPLDEN = 0; // Disabled loading of capture results
ECap1Regs.ECCTL2.bit.TSCTRSTOP = 0; // Stop the counter

ECap1Regs.TSCTR = 0; // Clear the counter
ECap1Regs.CTRPHS = 0; // Clear the counter phase register

ECap1Regs.ECCTL0.INPUTSEL=0;    (Please check it)

ECap1Regs.ECCTL2.all = 0x0096; // ECAP control register 2

ECap1Regs.ECCTL1.all = 0x01C4;

ECap1Regs.ECEINT.all = 0x0008;

interrupt void eCAP1_isr(void)
{
ECap1Regs.ECCLR.bit.INT = 1; // Clear the ECAP1 interrupt flag
ECap1Regs.ECCLR.bit.CEVT3 = 1; // Clear the CEVT3 flag

*******************************************************

PieCtrlRegs.PIEACK.all = PIEACK_GROUP4; // Must acknowledge the PIE group 4
}

After configuration, I have given a pulse of 200Hz to GPIO40. I am able to READ the value 0 OR 1 using GPIO DAT registor but i am not able to go into interrupt void eCAP1_isr. 

Kindly help for the same

  • Hi Rahul,

    The input configurations seem to be correct and your eCAP settings. Can you scope out the output signals and verify what you're seeing is what eCAP should also be seeing? Have you tried using SysConfig to set this up or imported any eCAP driverlib examples? 

    Do you have the following lines to enable the global interrupts? If not this should fix the problem with missing interrupt. 

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

    If the following suggestions do not address the error, please let me know!

    Best,

    Ryan Ma