Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
FreeRTOS demo using event group feature on OLED1 Xplained Pro

Overview

Introduction

This application demonstrates basic use of the FreeRTOS real-time operating system on SAM D devices. More specifically, it demonstrates use of tasks, queues, mutexes (semaphores) and event groups.

The application is designed to run on a SAM D Xplained Pro board with a OLED1 Xplained Pro wing board connected to EXT port.

After start-up, the application will display a pseudo-random graph that is continuously updated on the OLED, along with a menu bar at the bottom. The menu bar shows the selection of screens that the user has. By pressing the corresponding buttons on the OLED1 Xplained Pro wing board, the user can select between:

  • "Graph": pseudo-random graph.
  • "Term.": text received from terminal, i.e., the EDBG Virtual COM Port.
  • "About": short description of the application and use of terminal-screen.

Further, the LEDs on the OLED1 Xplained Pro wing board are lit up for the duration of the various tasks' loops, simply to give a visual representation of the task switching:

  • LED1: update of graph and handling of incoming terminal characters.
  • LED2: printing terminal and about text.
  • LED3: checking user selection, handling display buffer and menu drawing.

Note that several LEDs can be lit up at one time if one task is waiting for another task to release a resource. In this application, the resources would be the mutexes for the display and terminal text buffer.

To write text to the terminal window, one must connect to the EDBG Virtual COM Port with a terminal emulator at a baud rate of 9.6 kbaud. The demo will echo back the received characters.

For more details on the application:

For details on FreeRTOS and its API, go to the official FreeRTOS website.

Compiler information

This software has been tested with the GNU GCC. Other compilers may or may not work.

Contact information

For further information, visit Microchip.