Pages

Search in This Blog

Thursday 6 December 2012

CS RTOS port to ATmega32

A port of Glen Worstell's csRTOS to the ATmega32.

csRTOS is a priority-based co-operative scheduler that handles up to 8 tasks. This can be expanded to 16 tasks with little effort.

All user tasks, including ones run as the result of an ISR are assigned a fixed priority at compile time.

Semaphores are provided for protecting shared data.

Glen's code has several useful examples in setting up different types of tasks. This 2004 AVR design project is very well documented, which should enable you to easily modify the code for your application. 

Corrected functions below thanks to curtvm.

csRTOS_ATmega32v4.zip has corrected saveTask(), restoreTask() and ADC example.

Download Code here