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
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
Hello Martin
Ya this information was very helpful.
If you have codes(PIT and STM) of same please share.
Thanks and regards
goran
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
Hello Martin
Thank you for your valuable help.
Best regards
Goran