RTOS in Embedded Systems (Microcontrollers)

Posted on

Basics of RTOS

What is RTOS Real Time Operating System In Embedded Systems? – if you have learned embedded systems like on the arduino platform, you may have heard of the term RTOS. What exactly is an RTOS Means? The explanation is here.

In short, RTOS is a term that refers to the operating system (OS) for a processor. The point is to make processing program sets faster because it uses the Interrupt register, ISR (Interrupt Service Routine).


What is the Difference Between RTOS and Regular Programming?

To be able to know the difference, then we must understand the structure of the program and how the program will be executed.

In embedded software programming, the “Super Loop” is very well known because it is very widely used in programming models. Let’s see the difference between RTOS os and Super Loop below.

Super Loop Structure Program

In general, embedded software development uses a “Super Loop” or “Bare Metal” structure where the main program will continue to be executed repeatedly.

The problem using the Super Loop program structure is when the program handles a lot of certain functions.

If that happens, the system will be slower because the microcontroller (embedded systems development) must complete one function first, then execute the function after it.

For example, in the program was me made there are 3 functions. just say it A, B and C Function, where each of these functions has a set of programs to run certain commands.

The Super Loop structure will make the microcontroller run A function until it’s finished, after that, function B will to execute until it’s finish and after that C function is execute until it’s finished, then the program will run back to function A and repeat like that.

Because the execution time is getting longer, the response of the microcontroller that uses the “Super Loop” structure will be less sensitive.

RTOS Structure Progam

While RTOS offers a different way. Each function or set of programs will be executed concurrently.

The term concurrent here does not mean that it is processed at one time, but each set of programs will be broken down into small pieces and will be executed one by one from each function.

For example, functions A, B and C will be split into 8 parts.

A 8 parts, B 8 parts and C 8 parts.

The microcontroller will run first the first part of function A, then the first part of Function B, then the first part of Function C.

After that, the microcontroller will run the second part of function A, then the second part of function B, then the second part of function C.

The microcontroller will continue to perform the third part of each function up to the eighth part.

After that, just return to the first part.

Because of a system like this, the program will run faster near real time, hence the term Real Time embedded systems development.

RTOS in Embedded Systems (Microcontrollers)

FreeRTOS

After we know the term RTOS, then next we will get to know FreeRTOS. What is Free RTOS software?

FreeRTOS is one of the OS for RTOS.

In short like this, if the embedded computer has several OS such as Windows, MacOS and Linux, then the microcontroller has several OS such as FreeRTOS, Automotive RTOS, EUROS RTOS and others.

Why do we use FreeRTOS?

Because FreeRTOS has complete documentation and community.

Hopefully this article is useful.