Maker Pro
Maker Pro

design of RTOS using few features

vead

Nov 27, 2011
473
Joined
Nov 27, 2011
Messages
473
Hello everyone
I have question in mind. is it possible to develop RTOS program for microcontroller using some features. suppose I want use only kernel, multitasking and scheduling to develop RTOS Program. I have seen whole program of RTOS is very complex. so that's why I want to understand with few features. while reading I found that all RTOS should have Kernel , multitasking and scheduling . Is it possible to start with some few features for easy understanding?
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Yes, you can make a mult-tasking kernel without other RTOS features. I made one for PIC16 series that featured only cooperative multitasking with round robin scheduling and a single byte of flags for synchronization.

Bob
 

vead

Nov 27, 2011
473
Joined
Nov 27, 2011
Messages
473
Yes, you can make a mult-tasking kernel without other RTOS features. I made one for PIC16 series that featured only cooperative multitasking with round robin scheduling and a single byte of flags for synchronization.

Bob
Thank you very much for your response. can you tell me little bit. what you did in your project . what was the main purpose of your project.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
The main purpose was academic, to see what I could do with a very tiny microcontroller. I used a PIC12F575 which is very small indeed, If I remember correctly, only 32 bytes of memory.

I actually used it in a color changing LED application with a digital display and 3 button interface.

The processor cannot get hold of the return address from the hardware stack, which makes pre-emptive multi-taking pretty much impossible. So, I used a software stack and cooperative multitasking. Each task must complete it's work then call the wait() function. You could set a timer and wait for it, or just wait until your next round in the round robin. So, the app I used it in had three tasks.

1. The 3-color LED controller. This one was continuously changing the color of an RGB LED. It would set the next color, then set a timer for 10ms and call wait(). After 10ms it would get control again to set the next color.

2. The display was a multiplexed LED display. It would set up the data for one of the digits, then call wait().

3. The button handler would wait until any button was pressed, which caused an interrupt and set a flag that it was waiting for. It would then determine what button was pressed and, say, change the color pattern.


Bob
 
Top