Resetting an output compare pin of GPT in i.MX RT1060

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Resetting an output compare pin of GPT in i.MX RT1060

跳至解决方案
806 次查看
sung
Contributor I

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

0 项奖励
1 解答
762 次查看
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @sung,

I think the best one you mention is the best option and not much alternatives.

Best Regards,

Alexis Andalon

在原帖中查看解决方案

0 项奖励
2 回复数
763 次查看
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @sung,

I think the best one you mention is the best option and not much alternatives.

Best Regards,

Alexis Andalon

0 项奖励
757 次查看
sung
Contributor I

Hi Alexis,

Got it, thank you for the answer!

Best,
Sung

0 项奖励