Is Running RTOS on an 8-bit MCU Meaningful?

Most people start learning about microcontrollers with the most basic 8-bit MCUs. Generally, the three most common series of 8-bit microcontrollers are: the 51 series, AVR series, and PIC series.Recently, there was a discussion in a group about a question: Is it meaningful to run RTOS on a 51 microcontroller? Regarding this question, everyone has their own opinions. Below, we will specifically discuss the 51 series and RTOS.

About 8-bit Microcontrollers and Their Performance and Resources

8-bit microcontrollers can be considered classics for our generation because they have limited resources and are relatively simple, making them a popular choice for many beginners.1. Types of 8-bit MicrocontrollersThere are many types of 8-bit microcontrollers, and the most well-known is the general term for 8-bit MCUs.For example, early common microcontrollers include Intel’s 80C51 series, Atmel’s AT89C51 series, domestic Hongjing’s STC89C51 series, STM8 series, and companies like NXP and Microchip, all of which have 51 microcontrollers.In fact, many semiconductor companies that produced general-purpose MCUs had their own 51 microcontroller series, but with the emergence of 32-bit microcontrollers, many of the earlier 51 microcontrollers gradually faded from view.2. Performance of 8-bit MicrocontrollersNow let’s talk about the performance of 8-bit microcontrollers, which is mainly determined by the main frequency (or clock frequency), along with other factors such as bus width.Currently, the main frequency of 8-bit microcontrollers typically ranges from a few megahertz to several tens of megahertz. For example, the STC89C51 can reach a main frequency of up to 48M:Is Running RTOS on an 8-bit MCU Meaningful?At 48M, the speed is relatively high. This speed would be sufficient for running a GUI on a 32-bit MCU.However, on an 8-bit 51 microcontroller, due to limitations in bus data width and the lack of pre-processing operations, its performance is still significantly lower compared to 32-bit microcontrollers.To put it simply, running the same program, a 51 microcontroller at 48M cannot compete with a 32-bit microcontroller (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 for running RTOS.3. Storage ResourcesWhen we talk about resources, we also include peripheral resources such as ADC, I2C, etc. Since we are discussing RTOS here, we will mainly focus on 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 of 51 microcontrollers were relatively small. For example, the classic AT89C51 has only: 128 bytes of RAM and 4K of Flash.However, with the maturation of storage technology, the storage capacity of 51 microcontrollers has generally increased. For instance, the popular STC microcontrollers now have up to 8K of RAM and 64K of Flash.Is Running RTOS on an 8-bit MCU Meaningful?

What RTOS Can Be Used on 8-bit Microcontrollers?

Having discussed the performance and resources of 8-bit microcontrollers, let’s talk about which RTOS can run on them.Many early RTOS were adapted for popular 8-bit microcontrollers (with low-level drivers and examples), and even if they were not specifically adapted, they provided some general driver interfaces for broader selection.As chip manufacturing technology has matured and demand has increased (with richer software resources and higher requirements), many RTOS have generally shifted towards 32-bit MCUs, making some RTOS less friendly to 8-bit microcontrollers.However, there are still many RTOS available for 8-bit microcontrollers, although some are relatively niche and not widely known.Examples include Small RTOS, Keil’s built-in RTX51 Tiny, and the well-known uCOS, all of which can run on 51 microcontrollers.Additionally, RTOS such as AtomThreads, Chibios, CMX-Tiny+, and embOS have been adapted for 8-bit microcontrollers.When I was learning about 8-bit microcontrollers, I ran a highly trimmed version of uCOS, and it was not a problem to run two simple tasks.

Is Running RTOS on an 8-bit MCU Meaningful?

Many people might think:Now it is the era of 32-bit microcontrollers, and given the limited performance and resources of 8-bit microcontrollers, running RTOS can be quite challenging, so it seems meaningless to run RTOS on an 8-bit microcontroller.Indeed, this issue exists. However, I believe that whether it is meaningful depends on the situation. In certain cases, running RTOS on an 8-bit microcontroller can still be meaningful.1. Situations Where It Is Not MeaningfulCurrently, 32-bit MCUs do have advantages in many aspects, and 8-bit microcontrollers have inherent shortcomings. In many cases, running RTOS on a 51 microcontroller does not seem very meaningful.For example, in a large system that includes various peripheral modules and processes various business logic, it is not suitable to use an 8-bit microcontroller and run RTOS on it.Similarly, for a very simple system, such as a unit system that collects a temperature value and transmits it via serial, using RTOS would unnecessarily complicate the system.2. Situations Where It Is MeaningfulI believe that the existence of something must have its significance.For learning purposes, I think it is quite meaningful, as the programming mindset for RTOS is quite different from that of bare-metal programming.Some beginners who have mainly mastered knowledge of the 51 microcontroller may want to learn RTOS, and in this case, running RTOS on a 51 microcontroller becomes meaningful.Additionally, for a relatively simple project that uses many peripheral modules (or resources) while the overall business logic is not too complex and does not require handling too many events, such as temperature and humidity collection, key detection, etc., running tasks modularly through RTOS can still be quite meaningful.In conclusion, whether it is meaningful also depends on your actual situation.

Is Running RTOS on an 8-bit MCU Meaningful?

ENDSource: strongerHuangCopyright belongs to the original author. If there is any infringement, please contact for removal.Recommended Reading

Is Running RTOS on an 8-bit MCU Meaningful?

Leave a Comment