We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: Stevan Tosic
Last Updated: 2014-03-05
Package Version: 1.0.0.0
Category: Timers (Real time clock)
Downloaded: 2545 times
Followed by: 2 users
License: MIT license
Simple RTOS working in round-robin way with 1ms task switching. Number of tasks is five. Stacks size are configurable. Semaphores and timers examples are presented. Tasks progress is indicated by led blinking,
Do you want to subscribe in order to receive notifications regarding "RTOS for PIC 18F" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "RTOS for PIC 18F" changes.
Do you want to report abuse regarding "RTOS for PIC 18F".
DOWNLOAD LINK | RELATED COMPILER | CONTAINS |
---|---|---|
1318002025_rtos_for_pic_18f_mikroc_pic.zip [107.78KB] | mikroC PRO for PIC |
|
RTOS for PIC 18F is very simple and user friendly real time operating system. It runs on round-robin way with 1ms task switching. There are five examples with led blinking indicating tasks progress. Every example contain five tasks. One task (usually Task0) must work without sleeping or wait on semaphore. That means it should work continuously: computing or yielding. Every task should work in infinite loop.
I am sorry for lack of documentation but I hope that these simple examples are illustrative enough by themselves. Using RTOS needs very carefull planning of shared resources, commonly by semaphores.
Tasks are identified by 0, 1, 2, 3, 4 numbers.
Queues, events and messages are not implemented, but semaphore primitives can be used to implement these features.
Be carefull with reentrancies. Using local variables in tasks must be avoided.
Testing RTOS is very exiciting and unpredictable. Any comments will help me to improve this project not yet finished.
Functions:
void RTOS_Init(void);
void RTOS_Schedule(void);
int RTOS_StartScheduler(void);
void RTOS_StartTimer(void);
void RTOS_Yield(void);
void RTOS_CreateSemaphore(SEMPTR sem, int count);
void RTOS_OpenSemaphore(SEMPTR sem);
void RTOS_ReleaseSemaphore(SEMPTR sem);
void RTOS_Sleep(int ticks);
void RTOS_Suspend(int tid);
void RTOS_Resume(int tid);
void RTOS_MonoTask(void);
void RTOS_ResumeTasking(void);
void RTOS_KillTask(int tid);
void RTOS_Terminator(void);
Project is tested on Big PIC 5 Development system with PIC18F8520 and mikroC PRO 4.60.00.
Project:
rtoslib.mcppi
Library:
rtos.mcl