DanyR
Member level 3
- Joined
- Aug 23, 2015
- Messages
- 67
- Helped
- 6
- Reputation
- 12
- Reaction score
- 6
- Trophy points
- 8
- Location
- Nieuwpoort, Belgium
- Activity points
- 677
Pre-emptive RTOS for PIC32, written (almost entirely) in mikroPascal. Also an mikroBasic version is present.
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...
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-empting (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!
Documentation: See https://www.rosseeld.be/DRO/PIC/RTOS_PIC32.pdf
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...
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-empting (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!
Documentation: See https://www.rosseeld.be/DRO/PIC/RTOS_PIC32.pdf