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.

TMS320F28379D: ECAP oneshot vs continuous

Part Number: TMS320F28379D


Hello

Referring to what you had written in this thread

Essentially the only difference between one-shot mode and continuous mode is that 
for one-shot mode, the ECAP still captures in the background like continuous mode 
but new captures will not be loaded into the capture registers without re-arming.

If we have an interrupt linked to any capture event, does this mean in continuous mode operation the CPU keeps getting interrupted every consecutive event, irrespective of weather the ECAP mode is re-armed? 

Lets say I have an input pulse of 400 KHz, and the ECAP is configured to generate an interrupt at the 4th event, So in continuous mode , would we be getting an interrupt every consecutive 4th event?

Could you kindly clarify on the above.

Thanks,

AK

  • Hi AK,

    In continuous or one shot mode:

    The interrupt service routine must clear the global interrupt flag bit and the serviced event via the interrupt clear register(ECCLR) before any other interrupt pulses are generated.

    Best,

    Ryan Ma

  • Hi Ryan,

    I am clearing the global interrupt flag inside the  ISR. here is the ISR routine just in case:

    __interrupt void NTCECAp_ISR(void)
    {
        cap3_count = ECAP_getEventTimeStamp(M1_ECAP_NTC_BASE, ECAP_EVENT_3); //2nd raising edge
        cap4_count = ECAP_getEventTimeStamp(M1_ECAP_NTC_BASE, ECAP_EVENT_4); //2nd falling edge
     
        ECAP_clearGlobalInterrupt(M1_ECAP_NTC_BASE);
        ECAP_clearInterrupt(M1_ECAP_NTC_BASE, ECAP_ISR_SOURCE_CAPTURE_EVENT_4);
        Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP4);
    }

    But this doesn't answer my question:

    'If we have an interrupt linked to any capture event, does this mean in continuous mode operation the CPU keeps getting interrupted every consecutive event, irrespective of weather the ECAP mode is re-armed?'

    Could you kindly clarify.

  • Hi AK,

    The CPU keeps getting interrupted every consecutive event irrespective of whether eCAP mode is re-armed in continuous mode.

    Best,

    Ryan Ma