FreeRTOS on Arduino Due
Recently I got the chance to program the Arduino Due. This is powered by a 32 bit microcontroller from Atmel, the AT91SAM3X8E and runs at 84 MHz. The main goal was to deep dive into the FreeRTOS design and get to know the various features that are provided. Finally I managed to create my own RTOS port based on an older version https://github.com/greiman/FreeRTOS-Arduino.
I wanted to create a small project to incorporate 4 thing:
- user interaction
- sensor
- nvm storage
- display
All of these things should run in parallel and should be based as much as possible on already existing Arduino libraries (since the main focus was on the FreeRTOS and I did not wanted to reprogram the oled control over again).
The project worked out very well and in 2 days I managed to have-it finished. FreeRTOS is indeed a very interesting way to go especially if there are a lot of diffrent things to do in parallel and if the resources allows-it. I tried out first to doit on the Arduino Uno but this is too low on RAM. I only managed to get out 2-3 tasks! Moving up to the Mega seems to be a good solution but there I also see the already available port a little slow and at the limit. The tick configuration I believe is also a little to slow (15 ms). The RAM usage is not grat but yeah... sometimes it is required.
The Due on the other hand is perfect for the application from the performance point of view. The control is smooth and at around 10% RAM consumption I think is manageable.
My final toughs for the FreeRTOS are quite positive but only when moving up on the uC specs. 2Kb of RAM will not be sufficient! I think a minimum of 10Kb is required!
FreeRTOS for Due: https://github.com/bdmihai/DueFreeRTOS