MPC5748G STM

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

MPC5748G STM

1,809 Views
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 Kudos
Reply
2 Replies

1,551 Views
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 Kudos
Reply

1,551 Views
yankuang1
Contributor III

Hi Peter,

Thank you very much for your support

0 Kudos
Reply