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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
1,287 Views
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 Kudos
Reply
1 Solution
1,243 Views
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

View solution in original post

0 Kudos
Reply
2 Replies
1,244 Views
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 Kudos
Reply
1,238 Views
sung
Contributor I

Hi Alexis,

Got it, thank you for the answer!

Best,
Sung

0 Kudos
Reply