Osa Multi Tasking
Osa Multi Tasking
Osa Multi Tasking
EMBEDDED
SYSTEM LABS
listen, learn, practice and Do It Yourself
Menu
Skip to content
Embedded Linux
Microcontroller
RTOS
Electronic&PCB
Android
Embedded Software Design
OSA
IMPLEMENTATION OF A REAL TIME
OPERATING SYSTEM (OSA)
RTOS
Why RTOS?
Most microcontrollers developers writing sequential code for their
applications. The microcontroller will execute each function called
and asked what to do. This is good for small applications where
the microcontroller is supposed to do only one thing in particular.
Say you want to use your microcontroller to flash an LED and
nothing else or flash an LED and then display a string on the LCD
display, youd do well without feeling the need to implement a
system operating within your microcontroller. But for other
applications where more than one thing is supposed to be done at
the same time, youre stuck.
Have you ever felt that your computer works wonderfully when
writing documents, searching the net and listen to quran, all at the
same time. This is made possible byoperating systems that share
your processor time between tasks. All modern embedded systems
use an operating system of one sort or another.
About OSA
OSA is a non-preemptive RTOS cooperative for small memory
devices. Generally OSA is supported by almost all famous
including MPLAB compilers CCS PICC, the AVR studio and
MikroC Pro. It provides a large library of functions. And the
program structure is very similar to what you already know. In my
opinion OSA is an ideal choice for microcontroller-based
applications.
Task: A piece of code that the operating system will run. Task is a
function that the OS will call repeatedly.
Timer configuration
Why RTOS program requires configuring the timer! All RTOS
should keep track of time. Because every time the kernel needs to
know the time to generate accurate delays and calls scheduler
function. In fact, you can not track your dynamic architecture
without having any notion of time. You know that there is an
internal timer PIC that allows you to count the time. But the clock
of our operating system runs much slower than this timer. We
would therefore increment the clock of the operating system by
one tick each time the timer overflows is done.
I plan to have all tick every 1ms. This means that you will not be
able to call for delays less than 1 ms. Now start TimerCalculator
and select the following options.
Now we will write the code for each thread and create thereafter
purpose of performing the scheduler to complete our program like
this:
Once youve finished compiling your program and load the
executable in the PIC.
Downloads:
http://www.libstock.com/projects/download/398/0/398_timer_calc
ulator_v2.7.0.0.zip
http://www.pic24.ru/lib/exe/fetch.php/osa/history/osa_110306.zip
The config file generator
http://www.pic24.ru/lib/exe/fetch.php/osa/osacfg_tool_setup.rar
https://drive.google.com/folderviewid=0B29NykUKBqZ7elctWF
pWSXFIR1k&usp=sharing