Tool/software:
Hi experts,
I ask this for my customer.
My customer want to measure the High level time of the signal that input to DSP, now the ecap and epwm module is not enough. What's more, they don't want generate the Additional interruption to realize this function. They just want to check this value in their current PWM interrupt(30KHz)
So I suggest them to use this solution:
1. Using XINT1 that generate the XINT1 event in falling and rising edge.
2. Enable the Timer2.
3. Using XINT1 as the trigger source to trigger DMA to transfer the CPUTIMER TIM register to a buffer. DMA will set the burst is 2 to realize: when the first XINT generate(trigger in rising edge), the DMA place the TIM value to buffer[0], and when the second XINT generate(trigger in falling edge), the DMA place the TIM value to buffer[1]. And in the PWM interrupt, they use buffer[1] - buffer[0] to get the High level time of the input signal.
But now I have some problem,
1. Is this solution reasonable? Is it possible not generate the ISR but generate the XINT event to trigger DMA?
2. I think it can. But I can't trigger DMA, could you help to check if it any error in my configuration?
3. Since Timer will achieve its max value and will re-start from zero, so I can't guarantee the buffer[1] always greater than buffer[0]. So is it possible to let DMA place zero to TIM(reset Timer) in first XINT1(in the rising edge) and let DMA place TIM to buffer in second XINT1(in the falling edge)?
BRs
Shuqing




