Reseting timer interrupt by disabling and enabling.

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

Reseting timer interrupt by disabling and enabling.

1,347件の閲覧回数
kaustubhkagalka
Contributor II

Hi,

I am working on MK24FN1M0VDC12 MCU, and using Timer Interrupt for 8ms periodic interrupt. I need to sync this interrupt with an external trigger. I read from the K24 Sub-Family Reference Manual pg no 1050, that, to reset the timer, enabling and disabling the interrupt is required. I am using following function calls as follows.

if (TI1_Disable() != ERR_OK) {

         static int err1 = 0;

         err1++;

}

if (TI1_Enable() != ERR_OK) {

          static int err = 0;

          err++;

}

When these lines are executed the interrupt is completely disabled, and I never the periodic interrupt after that.

ラベル(1)
0 件の賞賛
返信
4 返答(返信)

1,164件の閲覧回数
kaustubhkagalka
Contributor II

Sorry to be hasteful, I found a code in my bug, I was perpetually resetting the interrupt timer, and hence was not receiving the interrupt. Disabling and enabling the timer component works fine.

Thanks for your support.

0 件の賞賛
返信

1,164件の閲覧回数
kaustubhkagalka
Contributor II

Hi,

I want to reset the timer count, but periodic interrupt would be permanently disabled after calling TI1_Disable(), even after using TI1_Enable() after that.

So for ex. if a periodic 8ms interrupt is scheduled to come at 8ms,16ms ,24 ms and so on. At time 27ms I wish to reset the timer so the next interrupt comes at (27+ 8 ) 35 ms.

I am sharing the project here, most of the logic is in the file Task1.c.

Also, I am trying to find a way to share my project or send you a zipped folder but I cant find a way to do that.

Kaustubh

0 件の賞賛
返信

1,164件の閲覧回数
kaustubhkagalka
Contributor II

Please ignore this sentence

"I am sharing the project here, most of the logic is in the file Task1.c."  in  the last comment. :smileyhappy:

0 件の賞賛
返信

1,164件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi Kaustubh Kagalkar,

Do you mean that the PIT periodic interrupt would become disable after disable and reable operation? And I was wonder if you can share the whole the demo.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信