The question about timers in the MQX

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

The question about timers in the MQX

Jump to solution
904 Views
小勇邹
Contributor II

There are two timer examples “hwtimer” and “timer”.

What is the difference between “hwtimer” and “timer”?

C:\Freescale\Freescale_MQX_4_1_TWRK64F120M\mqx\examples\hwtimer

C:\Freescale\Freescale_MQX_4_1_TWRK64F120M\mqx\examples\timer

0 Kudos
1 Solution
251 Views
soledad
NXP Employee
NXP Employee

Hello Robin,

The Timers are an optional component that extends the core-time component. An application can use timers:

• To cause a notification function to run at a specific time - when MQX RTOS creates the timer component, it starts Timer task, which maintains timers and their application-defined notification functions. When a timer expires, Timer Task calls

the appropriate notification function.

• To communicate that a time period has expired.

A task can start a timer at a specific time or at some specific time after the current time. Timers can use elapsed time or absolute time. There are two types of timers:

• One-shot timers, which expire once.

• Periodic timers, which expire repeatedly at a specified interval. When a periodic timer expires, MQX RTOS resets the timer

The HWTimer is a driver and it provides a C language API for uniform access to the features of various HW timer modules such as PIT and SysTick.

The hwtimer example shows usage of HW timer driver abstraction. Demonstrates how to initialize HW timer for various modules, set frequency, callback, start, and stop the timer.

The timer example is a simple demonstration of MQX timer component.

I hope this helps,


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
1 Reply
252 Views
soledad
NXP Employee
NXP Employee

Hello Robin,

The Timers are an optional component that extends the core-time component. An application can use timers:

• To cause a notification function to run at a specific time - when MQX RTOS creates the timer component, it starts Timer task, which maintains timers and their application-defined notification functions. When a timer expires, Timer Task calls

the appropriate notification function.

• To communicate that a time period has expired.

A task can start a timer at a specific time or at some specific time after the current time. Timers can use elapsed time or absolute time. There are two types of timers:

• One-shot timers, which expire once.

• Periodic timers, which expire repeatedly at a specified interval. When a periodic timer expires, MQX RTOS resets the timer

The HWTimer is a driver and it provides a C language API for uniform access to the features of various HW timer modules such as PIT and SysTick.

The hwtimer example shows usage of HW timer driver abstraction. Demonstrates how to initialize HW timer for various modules, set frequency, callback, start, and stop the timer.

The timer example is a simple demonstration of MQX timer component.

I hope this helps,


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos