Beginner Lab 13: Cooperative Scheduler

Last modified by Microchip on 2026/06/26 07:40

Objective

  1. 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.
  2. Develop a periodic task framework that enables coordinated execution of multiple functions without preemption.
  3. 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).

Download the ZIP file for this lab.

Information

The contents of this ZIP file need to be placed in the following folder:

<Any directory of the user's choice>/
(example Directory = C:/microchip/harmony/v3)

Note:

  1. An MPLAB® Harmony v3 project can be created in any directory. Its location does not depend on the Harmony framework path, so it does not need to be placed under the Harmony v3 framework folder or in any relative path beneath it.
  2. This is possible because MPLAB Harmony v3 projects generate all required source files, headers and libraries locally within the project folder.

Lab Index

Back to Top