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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
805件の閲覧回数
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 解決策
761件の閲覧回数
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 返答(返信)
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 件の賞賛
756件の閲覧回数
sung
Contributor I

Hi Alexis,

Got it, thank you for the answer!

Best,
Sung

0 件の賞賛