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.

TMS320F280037: How to check SOC trigger source

Genius 3215 points

Part Number: TMS320F280037

Hi All

I have selected CTR=0 and CTR=PRD of EPWM as the SOC trigger source for ADC.

The process uses the ADC value in the EOC interrupt.

Is there any way to determine whether the trigger this time was CTR=0 or CTR=PRD at the timing of this process?

Best Regards, 

Ito

  • Hi Ito-kaz,

    I am not aware of any way to determine whether the most recent event was CTR=0 or CTR=PRD. However the CLB does have access to the counter direction of the PWM. Perhaps that could be used to meet your application requirements? Why are you trying to determine whether the event was PRD or ZRO?

    Thank you,

    Luke

  • Hi Luke,

    Thank you for your reply.

    This is because we want to know whether ZERO or PRD is the cause of the interrupt.

    How can we use CLB to meet our application requirements?

    Best regards,

    Ito

  • Hi Ito,

    The CLB is actually not necessary for this. You can read the current counter direction via the TBSTS.CTRDIR bit. As long as your ISR begins within half a PWM period from the event that triggered the interrupt, this bit will reflect whether the interrupt was triggered by PRD or ZRO.

    Thank you,

    Luke