Nice work.You talk about avr, any chance to have it work on a due ? Because of low memory, I think it is difficult to use multitasking on an uno (but useful some times) easier on a mega.But I feel it will be mandatory on the due.Thanks for the job.

Nice work.You talk about avr, any chance to have it work on a due ? Because of low memory, I think it is difficult to use multitasking on an uno (but useful some times) easier on a mega.But I feel it will be mandatory on the due.Thanks for the job.

I wrote a little introduction to how it works here: http://www.chrismoos.com/2012/12/05/avr-os-multitasking-on-arduino

Hey

Interesting.

How much multitasking needs memory. Is it possible to check. I am not familiar with multitasking, but I know I would need it some times. So a basic question. Is it the spinlock which yields the processing to the next task. What about interrupts. And what about very long tasks where the processing is not ready when the next task begins.

How much multitasking needs memory. Is it possible to check. I am not familiar with multitasking, but I know I would need it some times. So a basic question. Is it the spinlock which yields the processing to the next task. What about interrupts. And what about very long tasks where the processing is not ready when the next task begins.

Leif

Edit: By the way, I'll probably use the mega or similar.

You can check out this file which shows you some of the memory overhead:

https://github.com/chrismoos/avr-os/blob/master/os_internal.h

Each task will use 256 bytes for stack and 18 bytes for the task definition (which actually could be reduced a bit with those last 2 pointers -- start_delay_secs and delayMillis). The task stack size is configurable in the build also.

The spinlock is not used to implement multitasking. A timer interrupt is fired which will interrupt your taks's processing. If your task processing is longer than a tick then potentially a new task will be executed (and the current one is suspended).

I have also ported these to the ARM Teensy 3.0 and Arduino Due. I have posted the Teensy 3.0 version and am finishing test for the Due version. I will probably merge the Teensy 3 and Due versions into one library.

FreeRTOS is very popular and has many users. Both systems are excellent and support a wide variety of RTOS features.

I personally like ChibiOS/RT on avr since it is a bit smaller but more people have used FreeRTOS on avr.