You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, everyone! I am a bit confused with the two timer modes that can be used. In the cyclic mode, I must set a timer to generate periodic interrupts at a given period (say 1ms) and call the COTmrService() inside the interrupt service routine, correct? In this case, the timer driver employed must be the co_timer_swcycle.c and the reload parameter of the DrvTimerReload() is the number of ticks to the next event.
In the delta mode, do I need to call COTmrService() inside the ISR? What is the meaning of the reload parameter in this case?
Thank you very much in advance.
The text was updated successfully, but these errors were encountered:
Yes, you are right. In delta mode, you need to call COTmrService() in ISR, too.
The difference to the cyclic mode is, that your timer driver must reprogram the timer on every event to the exact time intervall for the upcoming needed timer event. In other words, we will get interrupts at every event time and no interrupts in between.
what would be the unit of the reload parameter in delta mode? Seconds or it assumes a certain clock frequency for the timer and the reload is in ticks as well?
The unit of the reload parameter depends on your driver. I typically configure the timer with a frequency of 1MHz. Then you get an accuracy of 1tick = 1us. The reload parameter is in ticks which is equal to 1us - very comfortable. Just keep an eye on your timer overflow:
with a 32bit timer, you will get 4294s = ~1h - for my projects ok
with a 16bit timer, this is reduced to 65ms - this is not ok and will generate trouble!
Hello, everyone! I am a bit confused with the two timer modes that can be used. In the cyclic mode, I must set a timer to generate periodic interrupts at a given period (say 1ms) and call the COTmrService() inside the interrupt service routine, correct? In this case, the timer driver employed must be the co_timer_swcycle.c and the reload parameter of the DrvTimerReload() is the number of ticks to the next event.
In the delta mode, do I need to call COTmrService() inside the ISR? What is the meaning of the reload parameter in this case?
Thank you very much in advance.
The text was updated successfully, but these errors were encountered: