From the course: IoT Foundations: Operating Systems Fundamentals

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Use software timers

Use software timers

From the course: IoT Foundations: Operating Systems Fundamentals

Start my 1-month free trial

Use software timers

- [Instructor] The timer is important to the OS Kernel and the User Applications. An OS Kernel uses timers to schedule tasks, and User Applications use timers to schedule when, or at which frequency, a function can run. Let's see what the types of timers are. Every IoT device, or embedded device, has hardware clocks inside, such as an internal core clock. It also may have peripheral timers as hardware clocks to be used in an application. The way that a timer tells the OS when it expires is like this. A timer calculates the time ticks. When it expires, it generates a interrupt event that can be handled by an OS task. An OS usually provides the timer interface in the form of software timers, which may or may not rely on these hardware clock resources. We're talking about the software timer provided by the FreeRTOS, which can be useful in many cases. There are different ways of implementing a software timer where you can use a loop to do it, but it takes a lot of precious CPU time, or…

Contents