Is It Meaningful to Run RTOS on 51 Microcontrollers?

Follow+Star Public Account Number, Don’t miss wonderful content

Is It Meaningful to Run RTOS on 51 Microcontrollers?

Author | strongerHuang

WeChat Official Account | Embedded Column

Recently, I saw a discussion in my technical group about a question: Is it meaningful to run RTOS on 51 microcontrollers?
Today, I will talk about 51 and RTOS.

1About 51 Microcontrollers and Their Performance and Resources

The 51 microcontroller can be said to be a classic for our generation, as it has limited resources and is relatively simple, making it one of the must-choose options for many beginners.
1. Types of 51 Microcontrollers
There are many types of 51 microcontrollers, and here we use a general term that usually refers to 8-bit MCUs.
For example, commonly seen in the early market: Intel’s 80C51 series, Atmel’s AT89C51 series, domestic Hongjing’s STC89C51 series, STM8 series, and companies like NXP and Microchip also have 51 microcontrollers.

Is It Meaningful to Run RTOS on 51 Microcontrollers?

Is It Meaningful to Run RTOS on 51 Microcontrollers?
In fact, many semiconductor companies that made general-purpose MCUs had their own series of 51 microcontrollers, but with the emergence of 32-bit microcontrollers, many of the earlier 51 microcontrollers gradually left everyone’s sight.
2. Performance of 51 Microcontrollers
Now let’s talk about the performance of 51 microcontrollers, which is mainly determined by the main frequency (or clock frequency), as well as other factors such as bus width. (You can refer to the article “Is CPU Performance Determined by Main Frequency?“)
Currently, the main frequency of 51 microcontrollers usually ranges from several megahertz to tens of megahertz, for example, the STC89C51 can reach a main frequency of 48M:

Is It Meaningful to Run RTOS on 51 Microcontrollers?

48M speed is not low, and if it were a 32-bit MCU, it could run GUI applications.
However, this is on the 8-bit 51 microcontroller, and due to bus data width limitations and lack of pre-processing, its performance is still much lower than that of 32-bit microcontrollers.
To put it simply, running the same program, a 51 microcontroller at 48M cannot outperform a 32-bit machine (like STM32) running at the same frequency (48M).
Of course, if the 51 microcontroller runs at the maximum frequency of 48M, its performance is still sufficient to run RTOS.
3. Storage Resources
When we talk about resources, we usually include peripheral resources such as ADC, I2C, etc. Since we are discussing RTOS here, we will mainly talk about Flash (for code storage) and RAM (for runtime storage) resources.
In the early days, due to limitations in storage technology (the cost of producing Flash and RAM was very high), the resources were relatively small. For example, the classic AT89C51 has only: 128Bit of RAM and 4K of Flash.
However, with the maturity of storage technology, the storage capacity of 51 microcontrollers has generally increased. For example, the popular STC microcontrollers now have up to 8K of RAM and 64K of Flash.

Is It Meaningful to Run RTOS on 51 Microcontrollers?

2What RTOS Are Suitable for 51 Microcontrollers?

Having discussed the performance and resources of the 51 microcontroller, let’s talk about which RTOS can run on 51 microcontrollers.
Many early RTOS were adapted for popular 51 microcontrollers (low-level drivers, examples), and even if they were not adapted, some general driver interfaces were provided for more people to choose from.
As chip manufacturing technology has matured and demand has increased (more abundant software resources, higher requirements), many RTOS have generally leaned towards 32-bit MCUs, making some RTOS less friendly to 51 microcontrollers.
Of course, there are still many RTOS available for 51 microcontrollers, but some are relatively niche, and not many people are familiar with them.
RTOS like Small RTOS, Keil’s built-in RTX51 Tiny, and familiar uCOS can run on 51 microcontrollers.
I previously shared an article “Which RTOS Are Supported on STM8” that described how RTOS like AtomThreads, Chibios, CMX-Tiny+, and embOS have been adapted for 51 microcontrollers.
When I was learning about the 51 microcontroller, I ran a highly trimmed uCOS on it. Running two tasks was not a big problem, including an article I shared with everyone “Atomthreads Running on STM8” that provided corresponding examples for everyone to learn.

3Is It Meaningful to Run RTOS on 51 Microcontrollers?

Many people may think:Now is the era of 32-bit microcontrollers, and with the limited performance and resources of 51 microcontrollers, running RTOS is quite challenging, so it seems meaningless to run RTOS on 51 microcontrollers.
Yes, this is indeed a problem. However, I believe that whether it is meaningful depends on the situation. In some cases, running RTOS on 51 microcontrollers is still meaningful.
1. Cases Where It Is Not Very Meaningful
Currently, there are indeed advantages to 32-bit MCUs, and 51 microcontrollers have inherent shortcomings. In many cases, running RTOS on 51 microcontrollers does not seem very meaningful.
For example: a large system containing various peripheral modules and processing various business logic is not suitable for using a 51 microcontroller and running RTOS on it.
Another example: a very simple system, such as a unit system that collects a temperature value and transmits it via serial port. In simple projects, using RTOS may unnecessarily increase the complexity of the system.
2. Cases Where It Is Meaningful
I believe that the existence of something must have its significance.
For learning purposes, I think it is quite meaningful, after all, the programming thinking of RTOS is quite different from that of bare-metal programming.
Some beginners may currently mainly grasp the knowledge of 51 microcontrollers and want to learn RTOS. At this point, running RTOS on 51 microcontrollers seems meaningful.
For example: a relatively simple project that uses many peripheral modules (or resources), while the overall business logic is not too complicated and does not require processing too many events. Small projects like temperature and humidity collection, button detection, etc., can run tasks modularized through RTOS, which I think is still quite meaningful.
In the end, it still depends on your actual situation whether it is meaningful or not.
———— END ————

Reply “Embedded Software Design and Development” or “Microcontroller” to read more related articles.

Welcome to follow my public account, reply “Add Group” to join the technical group according to the rules, reply “1024” to see more content.
Welcome to follow my video account:

Is It Meaningful to Run RTOS on 51 Microcontrollers?

Click “Read the Original” to see more shares, feel free to share, save, like, and view.

Leave a Comment

Your email address will not be published. Required fields are marked *