why any rtos is not suitable for 8051

Thread Starter

rt694157

Joined Dec 15, 2019
78
I am looking for the clarification why any rtos is not suitable for 8051.

AT89C51- 8051 core
Program Memory Size: 4 kB
Data RAM Size:128 B
Maximum Clock Frequency:24 MHz

I found only two reason, speed and memory size. But really I don't know the reason behind it,

It's capable to execute instructions. It can store program. I couldn't figure out this stuff even after searching on google, why rtos is not suitable for 8051.
 
Last edited:

Papabravo

Joined Feb 24, 2006
21,159
I think the most obvious reason is the limitation of 128 bytes of data memory. It is hard to imagine that you could do a general purpose RTOS with that limitation. If you were to restrict yourself to a fixed number of predefined tasks, then a special purpose OS with timer interrupts and task scheduling could be possible. How do I know? I've done it.
 

Ian Rogers

Joined Dec 12, 2012
1,136
The 8051 is a good 8 bit MCU to use... There is an extended mode.. You can bolt on 16bit memory addressable chips.
If you can get hold of the original 8031, they were ROM less so you could have bigger data and code space, up to 64k of each.
 

Thread Starter

rt694157

Joined Dec 15, 2019
78
How do I know? I've done it.
Can you describe what you have done

  1. Does you're scheduler have single interrupt driven timer to keep track of system time
  2. Does you're Scheduler written in way so that it can be reused from one project to the next
  3. Does it capable of scheduling periodic and background tasks
 

Papabravo

Joined Feb 24, 2006
21,159
Can you describe what you have done
...
1. Does you're scheduler have single interrupt driven timer to keep track of system time​
There is a single system timer interrupt. It keeps tract of the system time and updates one of 8 task timers on each interrupt. So the task timers are updated at 1/8 the frequency of the system timer.
2. Does you're Scheduler written in way so that it can be reused from one project to the next​
It is possible but not really very convenient to do because it caters to a particular kind of system which involves communications and networking. In truth, I've never had an opportunity to try porting it to another application.
3. Does it capable of scheduling periodic and background tasks​
Yes, there is always a single background task that is ready to run. Each of the other tasks are associated with a peripheral device. and their interrupts run to completion and they can suspend themselves waiting for either a device interrupt or a timer expiration. When a device timer expires the scheduler will run that task with lower priority interrupts disabled.
It was nothing fancy, but it was amenable to a low end 8-bit processor. Our processor was built around a 74181 8-bit ALU (ca. 1971) which had both a low level assembly language and a higher level assembly language implemented with a threaded code interpreter. It would be roughly related to an implementation of FORTH.

Retro Programming: Threaded Interpretive Languages by R. G. Loeliger

The original source code was on a collection of 8-channel paper tapes which I was unable to keep when my employer and I parted company.

I believe we had 8K bytes of program space and 1K bytes of RAM. but 3/4 of the RAM was consumed by the display controller which would DMA the data from RAM to paint on the display.
 
Last edited:

MrChips

Joined Oct 2, 2009
30,708
If you are using a small MCU with limited memory then you cannot afford to run RTOS.
Instead, define and list all functions and time constraints that are needed. Create your own software to get the job done properly.
 

Papabravo

Joined Feb 24, 2006
21,159
I also know small mcu is not suitable because I have looked in many tutorial but I don't understand reason. What are the disadvantage with small mcu
Limited program space
Limited data space
Limited speed (Less of a problem now, than it used to be)
Limited development tools (but getting better all the time)
Having to break required operations into simpler parts. e.g most people don't know how to do fast multi-byte multiplication or long division.
Lack of appropriate addressing modes
Limited instruction set
 

MrChips

Joined Oct 2, 2009
30,708
And to counter that, the advantages of a small MCU and simpler software:

Small foot print
Low power
Lower complexity
Easier to debug
Lower dependency on third party software
More control
Not so random processes, more predictable
 

Ian Rogers

Joined Dec 12, 2012
1,136
I also know small mcu is not suitable because I have looked in many tutorial but I don't understand reason. What are the disadvantage with small mcu
The basic 8051 is too small, but because it's expandable, it's a good choice.. Up until recently, most highway information signs used this 8031 with RTOS... ( granted a "specially" made one..)
But a 8051 with 16k ram glued on will be more than enough..
 

MrChips

Joined Oct 2, 2009
30,708
Again, it depends on your definition of RTOS.

Is RTOS necessarily a commercially available third-party sw product?
Or can someone create their own RTOS?
 
Top