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.
Hello, I'm controlling ePWM by DCAEVT1.sync singal, so that ePWM1 is turned on for constant time at the rising edge of COMP1OUT.
Here, I would like to get period of the rising edge of COMP1OUT by getting TBCTR value of ePWM register.
So, I decided to use EPwm1.DCCAP register by setting DCCAPCTL.bit.CAPE = 1. However, DCCAP register returns 1 all times.
Now follows are the questions.
First, I thought that copying TBCTR to DCCAP would be faster than DCAEVT1.sync signal... is it right?
Second, in this case, what could be the best solution to get the period of the rising edge of COMP1OUT?
Thank you very much in advance.
Sincerely,
Your approach sounds reasonable. Have you tried to disable shadow mode through DCCAPCTL? If you are trying to read the DCCAP register immediately after the trip signal is asserted, you might be reading an old value.
The DCCAP value and DCAEVT1 signal time can diverge depending on the paths they are configured to take (for example, async oneshot vs filtered). By default, I would expect them to be very close.