Hi,
I have a question regarding resetting an output compare pin of the General Purpose Timer (GPT) in i.MX RT1060.
My application requires setting (i.e., output = 1) the output pin of the output compare channel 2 whenever a compare event in channel 2 occurs (compare value = 200). It also requires resetting (i.e., output = 0) the pin whenever a compare event in channel 1 occurs (compare value = 300), which is when the counter resets to 0 since the timer is set up as the restart mode. At the channel 1's compare event, an interrupt occurs.
The "setting" part is done by configuring the channel 2's operating mode as "set output pin".
What is the best way to implement the "resetting" part? It seems that reconfiguring the channel 2 as the "clear output pin" mode and generating a forced-compare event in the interrupt handler do the job, but I am wondering if there exists any simpler and more efficient way to accomplish this, ideally without any such repeated software intervention.
Thanks,
Sung
已解决! 转到解答。