Beginner Lab 13: Cooperative Scheduler
Last modified by Microchip on 2026/06/26 07:40
Objective
- Design and implement a cooperative scheduler that integrates SysTick, Universal Asynchronous Receiver Transmitter (UART), Analog-to-Digital Converter (ADC) and General Purpose Input/Output (GPIO) peripherals into a unified embedded system.
- Develop a periodic task framework that enables coordinated execution of multiple functions without preemption.
- Strengthen understanding of modular system design and time-based task management in embedded applications.
Overview
This lab introduces cooperative multitasking through the development of a simple scheduler that coordinates multiple peripherals, including SysTick, UART, ADC, and GPIO. The exercise emphasizes system‑level design, where multiple periodic tasks operate together in a structured and predictable manner. SysTick provides the system time base for task scheduling, while UART, ADC, and GPIO support practical input, output and data handling within the scheduler.
Lab Activities
- Develop a cooperative multitasking framework using SysTick as the system scheduler tick
- Implement periodic tasks that manage UART communication, ADC sampling and GPIO control
- Integrate individual peripheral modules into a cohesive scheduler architecture
- Observe and verify correct task execution, timing consistency and system responsiveness under cooperative scheduling
Expected Outcomes
Upon completing this lab, you will be able to:
- Design and implement a cooperative scheduler for embedded systems
- Integrate multiple peripherals (SysTick, UART, ADC, GPIO) within a modular software architecture
- Understand periodic task scheduling and non‑preemptive multitasking concepts
- Comprehend modular design principles and structured multitasking in advanced embedded applications
Lab Source Files and Solutions
This ZIP file contains the completed solution project for this lab. It also contains the source files needed to perform the lab as per the following step-by-step instructions (see the "Lab Index" section on this page).
for this lab.
Lab Index
- Step 1: Cooperative Scheduler
- Step 1.1 - Understanding Scheduler
- Step 2: Configuration of MCC
- Step 2.1 - Configuration of MCC
- Step 3: Generate Code
- Step 3.1 - Generate Code
- Step 4: Add Application Code to the Project
- Step 4.1 - Add Application Code to the Project
- Step 5: Build, Program and Observe the Output
- Step 5.1 - Hardware Setup
- Step 5.2 - Building the Project
- Step 5.3 - Programming and Observing the Output