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.

TMS320C283446 multiple ecap peripherals' reset



Hello,

I am using ecap1 and ecap3 peripherals  to capture signals that differ in nanoseconds.  I need to reset ecap1 and ecap3 counters so that they start at the same time. 

Performing the following actions

ECap3Regs.TSCTR = 0;                                                                        

ECap1Regs.TSCTR = 0;

 

does not work me as I am introduce a delay of one clock cycle between the two resets.

 

How do I reset both ecap counters on the same clock cycle?

 

Thanks

Monika

  • Monika,

    I would recommend looking at the SWSYNC bit of ECCTL2 the eCAP module.  It forces synchronization of any downstream eCAP modules provided that they are configured correctly.  This is documented in the TMS320x2384x Delfino Enhanced Capture (eCAP) Module User Guide (http://www.ti.com/lit/sprug79).


    Thank you,
    Brett

  • Brett,

    I am using Ecap1 and Ecap3 modules.  To perform the counter synchronization of both of the ecaps as mentioned earlier, I set ecaps as follows

    ECap1Regs.ECCTL2.bit.SYNCO_SEL = 0;

    ECap1Regs.ECCTL2.bit.SYNCI_EN = 1;

    ECap3Regs.ECCTL2.bit.SYNCI_EN = 1;

    ECap3Regs.ECCTL2.bit.SYNCO_SEL = 0;

     

    After  initailization I set:  ECap1Regs.ECCTL2.bit.SWSYNC=1; 

     

    ecap1 and ecap 3 still differ by 1 clock tic.  Note : both peripherals have the same external signal connected to them that they measure.

     

    Is there anything else I should be doing or setting?

     

    thanks

    Monika

  • Monika,

    What do you have the CTRPHS value configured to in each of these ECap modules?

    Assuming that you have ECap3's CTRPHS set as 0, what happens when you set it to 4?   Do the two CAP modules then differ by more ticks?


    Thank you,
    Brett

  • Hello Brett,

    ECAP1.CTRPHS = 0 and ECAP3.CTRPHS = 4 setting yields a difference of 3 tics .

    Following your logic: ECAP1.CTRPHS = 0 and ECAP3.CTRPHS = 1 setting yields a difference of 0 tics which is what I am looking for.

    Not exactly sure why the ecaps need to be offset in phase if the same signal is being measured but it does the trick.

    thanks

    Monika