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.

AM3358: AM3358: eCAP

Part Number: AM3358

In a previous project I used eCAP input capture to determine the speed of a position sensor (encoder) by capturing the time between rising edges using the following register settings.

CT_ECAP.ECCTL1 = 0x0102; //CAP1POL=RISING,CTRRST1=DELTA_MODE,CAPLDEN=ENABLE,PRESCALE=DIV1
CT_ECAP.ECCTL2 = 0x00D0; //CAP_MODE,CONTINUOUS,SYNCO=DISABLE,SYNCI=DISABLE,TSCTRSTOP=RUN

This worked great! Now I'm trying something a little different.

Working from page 2486 of the Technical Reference Manual, I'm trying to measure the time between edges of the following waveform using these register settings.

CT_ECAP.ECCTL1 = 0x01BB; //CAP1POL=FALLING,CAP2POL=RISING,CAP3POL=FALLING,CAP4POL=RISING,CTRRSTx=DELTA_MODE,CAPLDEN=ENABLE,PRESCALE=DIV1
CT_ECAP.ECCTL2 = 0x00D0; //CAP_MODE,CONTINUOUS,SYNCO=DISABLE,SYNCI=DISABLE,TSCTRSTOP=RUN

When I read the capture registers, I get the following:

CT_ECAP.CAP1 = 3685 (~18.4 uS) Repeated readings vary a little. Is it measuring time between falling edges? I don't know.

CT_ECAP.CAP2 = 51 (0.255 uS) Always. Does not vary with repeated readings, and CT_ECAP.ECFLG_bit.CEVT2 is never set.

CT_ECAP.CAP3 = 673834936 (3.34 seconds) Always. Does not vary with repeated readings, and CT_ECAP.ECFLG_bit.CEVT3 is never set.

CT_ECAP.CAP4 = 673838403 (3.37 seconds) Always. Does not vary with repeated readings, and CT_ECAP.ECFLG_bit.CEVT4 is never set.

I was expecting CT_ECAP.CAP2 to be the low time of the first low pulse (~5 uS), CT_ECAP.CAP3 to be the high time after the first low pulse (~13.8 uS), and CT_ECAP.CAP4 to be the low time of the second low pulse (~4 uS).

Any idea what I'm doing wrong?