design of RTOS using few features

Discussion in 'General Electronics Discussion' started by vead, May 19, 2017.

  1. vead

    vead

    Joined:
    Nov 27, 2011
    Messages:
    468
    Likes Received:
    14
    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?
     
    vead, May 19, 2017
    #1
    1. Advertisements

  2. vead

    BobK

    Joined:
    Jan 5, 2010
    Messages:
    6,867
    Likes Received:
    1,401
    Location:
    Worcester, MA
    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
     
    BobK, May 19, 2017
    #2
    vead likes this.
    1. Advertisements

  3. vead

    vead

    Joined:
    Nov 27, 2011
    Messages:
    468
    Likes Received:
    14
    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.
     
    vead, May 19, 2017
    #3
  4. vead

    BobK

    Joined:
    Jan 5, 2010
    Messages:
    6,867
    Likes Received:
    1,401
    Location:
    Worcester, MA
    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
     
    BobK, May 20, 2017
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.