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.

TMS320F2800156-Q1: Enhanced Capture

Part Number: TMS320F2800156-Q1
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Development environment:

MCU: TMS320F2800156-Q1

TRM: TMS320F280015x Real-Time Microcontrollers Technical Reference Manual_RevB_.pdf

CCS: 12.7

SDK: C2000Ware_5_02_00_00

Figure 1

Figure 2:

Figure 1 is sourced from TRM
Figure 2 shows the code generated based on syscfg. 

Question 1 (ECAP module operates in capture mode): 

Why doesn't function ECAP_resetCounters() (CTRFILTRESET) reset event prescaler?
Question 2 (ECAP module operates in capture mode): 

If I set event prescaler to non-zero(don't bypass the prescale logic), I won't be able to get the correct duty cycle and can only detect the frequency, is it right?

/BR

Samuel

  • Part Number: TMS320F2800156-Q1

    Tool/software:

    Development environment:

    MCU: TMS320F2800156-Q1

    TRM: TMS320F280015x Real-Time Microcontrollers Technical Reference Manual_RevB_.pdf

    CCS: 12.7

    SDK: C2000Ware_5_02_00_00

    Figure 1

    Figure 2

    Figure 1 is sourced from TRM
    Figure 2 shows the code generated based on syscfg. Why not call function ECAP_clearGlobalInterrupt() to clear ECFLG.INT?

    /BR

    Samuel

  • Hello, 

    The thread was wrongly auto assigned, I have assigned it to appropriate Subject Matter Expert.

    Apologies for the inconvenience and delay

    Regards, 

    Subham M

  • Hi Samuel,

    Why doesn't function ECAP_resetCounters() (CTRFILTRESET) reset event prescaler?

    This function does not reset the event prescaler since those are dividers used and are not be changed during run time. However this CTRFILTRESET will reset the prescaler logic. Which when the prescaler is used, and the CTRFILTRESET occurs, the counters reset and the prescale logic is reset. 

    If I set event prescaler to non-zero(don't bypass the prescale logic), I won't be able to get the correct duty cycle and can only detect the frequency, is it right?

    You will have to calculate the duty based on your new prescale value, as well as the frequency. If you do divide by 2, then your captured values will need to include a multiply by 2 to get the actual number of SYSCLK.

    Figure 2 shows the code generated based on syscfg. Why not call function ECAP_clearGlobalInterrupt() to clear ECFLG.INT?

    Nothing is stopping for you to do this as well. However the example showcases clearing all flags individual for demostration purposes.

    Best,

    Ryan Ma