TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139262 times)
  2. FAT32 Library (71751 times)
  3. Network Ethernet Library (57124 times)
  4. USB Device Library (47430 times)
  5. Network WiFi Library (43090 times)
  6. FT800 Library (42404 times)
  7. GSM click (29835 times)
  8. mikroSDK (28079 times)
  9. PID Library (26885 times)
  10. microSD click (26198 times)
Libstock prefers package manager

Package Manager

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]

< Back
Project

RTOS for PIC 18F

Rating:

4

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,

No Abuse Reported

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".

  • Information
  • Comments (6)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Project Blog

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

ALSO FROM THIS AUTHOR

PID control simulation on GLCD

0

Typical control system with PID controller is simulated and variables (input, error, output, control) are drawn on GLCD screen using PID and Bars libraries.

[Learn More]

Simple multitasking driven by state machine

0

State machine programming style and task functions are used to implement tasks running through their states. There are versions of code with or without timer interrupt (Multitasking.c and MultitaskingNoInterrupts.c). Code is portable to any uC.

[Learn More]

Multi Timers using Event driven programming for PIC 18F8520

9

How to use Multi Timers for PIC 18F8520 in easy and user friendly way with additional library.

[Learn More]