Table of Contents

OSA : Introduction

What is OSA?

OSA is a cooperative multitasking real-time operating system (RTOS) for Microchip PIC-controllers PIC10, PIC12, PIC16, PIC18, PIC24, dsPIC, for Atmel AVR 8-bit controllers, and for STMicroelectronics STM8.

RTOS allows the programmer to focus on problem-oriented tasks (algorithmic, mathematical etc.) and not have to worry about secondary tasks. All secondary tasks are performed by OSA's kernel:

A task in OSA is a C-function. This function must contain an infinite loop which has inside it at least one service that switches task context. A simple task can look like this:

void SimpleTask (void)
{
    for (;;)        // Infinite loop
    {
        OS_Yield(); // Unconditional context switching
    }
}

Compilers

PIC

PIC10/12 PIC16/12 PIC16F1xxx PIC18 PIC24/dsPIC
HT-PICC STD
HT-PICC PRO
Microchip C
mikroC PRO
CCS PICC

AVR

AVR 8-bit
WinAVR
IAR
Code Vision AVR

STM8

STM8
Cosmic
IAR
Raisonance

Limitations

HT-PICC HT-PIC18

void interrupt int_routine (void)
{
    char var1, var2;
    int var3;
 
    // After definition of local variables we need to save FSR:
    OS_EnterInt();
    /*...*/
    /* Interrupt flags checking */
    /*...*/
 
    // At the end of ISR we need to restore FSR:
    OS_LeaveInt();
}

These services save and restore the FSR value (FSR0 for htpicc18), since HT-PICC sometimes does not do it.

Microchip C18

Microchip C30

12-bit chips

mikroC PRO for PIC16

CCS PICC

IAR (AVR and STM8)

WinAVR

STM8

Thanks to

Thanks to all who took part in identifying and correcting bugs. Most thanks to Vadim Frank and to D. Ivanov who was a most active assistant and showed patience and perseverance.

Special thanks to Roger Burrows who corrected a lot of my errors in the English documentation.

Also thanks to Alex B. who provided the site for documentation and assistance in its placement on the site.