Project 2—Using Round-Robin Multitasking With Variable CPU Time Allocation

In this project, we will be developing and using a round robin-type multitasking software with variable CPU time allocation. The software, called RTOS.C, can be included in multitasking programs. Each task is allocated maximum processing time selected by the user. The scheduler terminates a task when this time is reached, or when the task voluntarily gives-up CPU time by calling a function. The scheduler is interrupt driven and activates the tasks in order.
Each task in the user program is organized as a C function, running forever in a loop. The first thing a task does is to call scheduler function InitTask, which saves the task return address in an array called TStack. ...

Get PIC Microcontroller Projects in C, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.