Goals and Objectives

In this project we build a simple sentry robot as a multi-threaded embedded application using an RTOS. We also port our existing sentry behaviour code to MEGA-1284P Xplained microcontroller board. The primary objectives of this project includes:
  • measuring CPU utilization and I/O latency, and
  • implementing a multi-threaded embedded application using an RTOS.
We will describe the development toolchain for MEGA-1284P Xplained microcontroller board in Section Setup. In particular, we will mention the modification needed to the development toolchain we described for Seeduino Mega 1280 microcontroller board used in Section Setup of Project 1.

The hardware components used in this project and in Project 1 are exactly the same, except for a different microcontroller board. In Section Hardware we will mention key features of MEGA-1284P Xplained, and describe wiring schematics -- ports and pins used for different sensor inputs, power, UART, etc. We will also provide some test codes to highlight the differences between MEGA-1284P Xplained and Seeduino MEGA 1280, for example, how to blink LEDs, and how to communicate with the Roomba while printing in a hyper-terminal by UART0 and UART1. We will also describe the need for pull-down resistors in MEGA-1284P Xplained.

The behaviour of our Sentry robot remains the same in both the projects; see Section Sentry of Project 1. In Section Sentry of this project we will describe how we have ported interrupt and timer driven codes of Project 1 to schedulable thread-based periodic tasks in an RTOS. To transform timer and interrupt driven codes of Project 1 to schedulable periodic tasks, we measured CPU times needed by these tasks using an USB-based logic analyser made by Saleae and created a number of threads each of them responsible for only a single interrupt or timer driven task. We will also describe synchronizing mechanisms and different timing requirments in that section.

In Section Discussion we will describe the benefits we achieved using an RTOS compared to only timer and interrupt driven application. In particular, by using an RTOS we gained predictability which we lacked in Project 1.