TMS320F280049C: Input Capture using eCAP Module

Part Number: TMS320F280049C


i am using eCAP module to capture difference in the time period of pulses from Speed Hall sensor. But i am not getting accurate measurement of my pulses . Input Pulses are at frequency of 10Khz and i have set the Time period of eCAP as 25Mhz. I am expected to capture 1 pulse high rising edge and next cycle rising edge and then compute the difference .

Here is my eCap Configuration 

image.pngimage.png

  • i am using eCAP module to capture difference in the time period of pulses from Speed Hall sensor. But i am not getting accurate measurement of my pulses . Input Pulses are at frequency of 10Khz and i have set the Time period of eCAP as 25Mhz. I am expected to capture 1 pulse high rising edge and next cycle rising edge and then compute the difference .

    Hi Rishabh,

    Have you tried to take a look at our existing software SDK examples for eCAP?

    Best regards,

    Ryan Ma

  • Yes Ryan, I have checked with SDK Example modules for eCAP but was not compiling due to some its ISR configuration. so instead of going through TI API's i read Technical reference manual where with help i configured eCAP. 

    I think my eCAP clock is very fast i.e. 25Mhz as compared with PWM i.e. 10Khz . 

    Let me know if i am thinking in the right direction

  • Hi Rishabh,

    I think my eCAP clock is very fast i.e. 25Mhz as compared with PWM i.e. 10Khz . 

    eCAP is clocked by SYSCLK. What are the capture values you're reading from CAP1/2/3/4? When setting prescale to /4, that doesn't affect the eCAP clock itself and only /4 the input frequency that you're sampling. Set this to /1, and see if you read the correct values for your input you're sampling.

    ePWM is also clocked by SYSCLK, unless you're using some dividers within the ePWM peripheral such as HSPCLK, or CLKDIV which will slow down the PWM clock and must be accounted for when reading the CAP1/2/3/4 registers.

    Best regards,

    Ryan Ma