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: dany
Last Updated: 2017-09-30
Package Version: 1.2.0.0
Category: Other Codes
Downloaded: 3171 times
Followed by: 3 users
License: MIT license
Pre-emptive RTOS for PIC32, written (almost entirely) in mikroPascal/mikroBasic/mikroC.
The way of working is very easy to understand. The functionality is kept very limited with respect to other RTosses, to keep it simple.
The library code only consists of 1 .mpas file...
Do you want to subscribe in order to receive notifications regarding "RTOS for PIC32" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "RTOS for PIC32" changes.
Do you want to report abuse regarding "RTOS for PIC32".
DOWNLOAD LINK | RELATED COMPILER | CONTAINS |
---|---|---|
1506771363_rtos_for_pic32_mikropascal_pic32.mpkg [4.06MB] | mikroPascal PRO for PIC32 |
|
1506771414_rtos_for_pic32_other_pic32.zip [3.76MB] | Other PIC32 Compilers |
|
1506771454_rtos_for_pic32_mikrobasic_pic32.mpkg [3.53MB] | mikroBasic PRO for PIC32 |
|
1442850201_rtos_for_pic32_mikroc_pic32.mpkg [1.78MB] | mikroC PRO for PIC32 |
|
Pre-emptive RTOS (scheduler) for PIC32 and mP/mB/mC PRO.
Features:
- Delays in tasks performed by the RTOS (using OS_Delay in stead of delay_ms), giving other tasks the possibility to execute during that waiting time.
- Binary and Counting semaphores, with or without timeout.
- Starting, stopping and replacing (stop current task, start another one) tasks.
- Signalling semaphores both from interrupts and the main thread.
- Task priorities (priority 0 being the highest one)
- Tasks are executed in the main thread, not in an interrupt routine.
- The RTOS timebase is timer 1, using interrupt priority 6 (to prevent the usage of the shadow register set). So, all timed activities have a resolution of 1 timertick. A very suitable value for 1 timertick is e.g. 1 millisecond.
- The max task execution time is 10 timerticks. This is the longest time a task will be executed, after that another task (or the same, depending on eligibility of other tasks) will be chosen for execution. If a task is pre-empted by another one the execution time will be shorter of course.
This automatic task switching every 10 timerticks can be disabled by defining a compiler directive. Doing this the RTOS becomes a CRTOS (cooperative RTOS).
- Pre-emptive (if a task with a higher priority than the current one executed becomes eligible then it gets executed first)
- Tasks with the same priority are executed in a "round Robin" (sequential with wrap around) manner.
- Idle procedure (optional)
- Stack usage measurement (optional)
- Critical sections in the tasks are possible.
Have fun!
Keywords:
- scheduler
- pre-emptive
- priority
- semaphore
2015-07-30: Changed the documentation (stack usage function) and the library dependancies in the package.
2015-08-06, version 1.1:
- Added the "Critical Section" procedures (Enter- and LeaveCriticalSection)
- R1 is not part of the context any more (GP never changes)
- Made the Timer1Int routine does not make any "calls" anymore (could give problems)
2015-08-09, v 1.2:
- Added OS_NO_AUTO compiler directive (in RTOS_Defines.pld) to disable automatic task switching, setting this directive makes the system a cooperative RTOS (CRTOS)
- Always restart the 10 timerticks counter when a new task is (to be) selected
- Forced the first task selection now (in OS_Run): faster starting of first task
- Added the "Check_Events_ISR" again in the semaphore test/read routines to prevent 1 timertick delay
- Made "RestoreInterrupts" inline code. (no calls are allowed in the timebase interrupt routine)
2015-08-14:
- Added the instructions "DI" and "EHB" to the epilogue code of the OS interrupt routine.
- Fetched the interrupt Priority from the "Cause" coprocessor register to put in the "Status" register
- Added always a "rdpgpr sp, sp" to the beginning of the interrupt prologue
2015-08-16: Added the mB version of the library (not tested, only compiled).
2015-09-20: Updated the examples: the memory manager was not initialised in them... Sorry for the inconvenience.
2015-09-21: Added, thanks to aCkO the mC for PIC32 version package (.mpkg) and the updated the zip file. I hope there is a lot of interest from the mC community!