For OS tick time which is better :-System Timer Module (STM) or Periodic Interrupt Timer (PIT)

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

For OS tick time which is better :-System Timer Module (STM) or Periodic Interrupt Timer (PIT)

3,466件の閲覧回数
goranivan
Contributor II

I am using MPC5606B micro , i am using the schedulers, My OS tick time is 1msec , with 32mHz system clock generated by external 8Mhz clock. For every 1msec interrupt i call the scheduler. I want to know which one is better, whether STM or PIT. If you have a example code please share, it will be every helpful for my reference.

 

Best regards

Goran

ラベル(1)
4 返答(返信)

2,847件の閲覧回数
martin_kovar
NXP Employee
NXP Employee

Hello Goran,

from my point of view, PIT is much more better than STM. PIT timer counts down from set value (LDVAL register) to 0. After zero is reached Timer Interrupt Flag is set and timer counter (CVAL register) is reset to original set value (in LDVAL register) and process is repeated. This is pretty simple and it perfectly fits for your task.

STM works different. There is compare register you set and timer counts from 0 to FFFFFFFF. After compare register is reached, Timer Interrupt Flag is set, but timer continue with counting up. So in every interrupt, you have to stop counter and reset it's CNT register to 0 and enable counter again. In this case, timing is not as accurate as in case of PIT timer.

Hope it helps.

Regards,

Martin

2,847件の閲覧回数
goranivan
Contributor II

Hello Martin

Ya this information was very helpful.

If you have codes(PIT and STM) of same please share.

Thanks and regards

goran

0 件の賞賛
返信

2,846件の閲覧回数
martin_kovar
NXP Employee
NXP Employee

Hello,

for PIT configuration, please see following example:

Example MPC5607B PinToggleStationery CW210 

I am attaching simple example for STM (example is created for MPC5604P, but you can use it for MPC5606B) directly to this post.

Regards,

Martin

2,846件の閲覧回数
goranivan
Contributor II

Hello Martin

Thank you for your valuable help.

Best regards

Goran