MPC5748G STM

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

MPC5748G STM

1,776件の閲覧回数
yankuang1
Contributor III

I encountered the following two problems when testing the System Timer Module,the test code is shown in the figure.

pastedImage_1.pngpastedImage_2.png

1.After each interrupt is generated, the CNT register must be configured in addition to clearing the CLR register.If the CNT register is not reconfigured, the next interrupt will not be generated.Is this the correct way to operate SMT?

2.I found that the timers generated by SMT were not accurate.For example, I configured the timer to 1000 milliseconds,after executing an interrupt function, the next timer time becomes 1030 milliseconds.

0 件の賞賛
返信
2 返答(返信)

1,518件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hi,

1. Yes

2. You are not using it in correct way.

After STM reach compare value, triggers an interrupt. You have to configure compare register. Just increase its value by value when you want next interrupt occur. On background of this interrupt routine counter is still running.

When counter reach this increased compare value you will get another interrupt. Just in accurate time.

Peter

0 件の賞賛
返信

1,518件の閲覧回数
yankuang1
Contributor III

Hi Peter,

Thank you very much for your support

0 件の賞賛
返信