Multitasking And Real-Time Arduino System

This simple project shows how Arduino can be used with a RTOS. A special version of Arduino called ARTe was used for software development.

May 16, 2017

42897 views

11 respects

Components and supplies

1

Ultrasonic Sensor - HC-SR04 (Generic)

1

Temperature Sensor

1

Arduino UNO

3

LED (generic)

Apps and platforms

1

ARTe (Arduino Real-Time extension)

Project description

Code

Multitasking-RealTime-Arduino-System

This simple project shows how Arduino can be used with a real time operating system (Erika). A special version of Arduino called ARTe was used for software development ( http://retis.sssup.it/?q=arte ). ARTe (Arduino Real-Time extension) is an extension to the Arduino framework that supports multitasking and real-time preemptive scheduling. Thanks to ARTe, the user can easily specify and run multiple concurrent loops at differents rates, in addition to the single execution cycle provided by the standard Arduino framework. Today ARTE supports the most popular platforms: Arduino UNO and Arduino DUE. In addition to the single loop present in the standard Arduino approach, the user can easily specify a number of concurrent loops to be executed at specific rates. Concurrency and real-time scheduling is provided by the ERIKA Enterprise (http://erika.tuxfamily.org/drupal/) open-source real-time kernel. Loops can use the standard Arduino libraries, which have been enhanced to guarantee mutual exclusion in the access of shared data structures. The impact of ARTe in terms of footprint and runtime overhead has beed evaluated by extensive tests and resulted to be negligible. In this project was used to run 3 periodic processes that handle different activities. A process for managing every 3 seconds the acquisition of the distance through the sensor HC-SR04. Another process for flashing a LED every 7 seconds. A final process to read the temperature returned by the LM35 sensor expressed in degrees Celsius is executed every 11 seconds. All processes are managed in real time mode.

Multitasking and Real-Time Arduino Processing

arduino

This simple project shows how Arduino can be used with a real time operating system (Erika). A special version of Arduino called ARTe was used for software development ( http://retis.sssup.it/?q=arte ). ARTe (Arduino Real-Time extension) is an extension to the Arduino framework that supports multitasking and real-time preemptive scheduling. Thanks to ARTe, the user can easily specify and run multiple concurrent loops at differents rates, in addition to the single execution cycle provided by the standard Arduino framework. Today ARTE supports the most popular platforms: Arduino UNO and Arduino DUE. In addition to the single loop present in the standard Arduino approach, the user can easily specify a number of concurrent loops to be executed at specific rates. Concurrency and real-time scheduling is provided by the ERIKA Enterprise (http://erika.tuxfamily.org/drupal/) open-source real-time kernel. Loops can use the standard Arduino libraries, which have been enhanced to guarantee mutual exclusion in the access of shared data structures. The impact of ARTe in terms of footprint and runtime overhead has beed evaluated by extensive tests and resulted to be negligible. In this project was used to run 3 periodic processes that handle different activities. A process for managing every 3 seconds the acquisition of the distance through the sensor HC-SR04. Another process for flashing a LED every 7 seconds. A final process to read the temperature returned by the LM35 sensor expressed in degrees Celsius is executed every 11 seconds. All processes are managed in real time mode.

Multitasking-RealTime-Arduino-System

This simple project shows how Arduino can be used with a real time operating system (Erika). A special version of Arduino called ARTe was used for software development ( http://retis.sssup.it/?q=arte ). ARTe (Arduino Real-Time extension) is an extension to the Arduino framework that supports multitasking and real-time preemptive scheduling. Thanks to ARTe, the user can easily specify and run multiple concurrent loops at differents rates, in addition to the single execution cycle provided by the standard Arduino framework. Today ARTE supports the most popular platforms: Arduino UNO and Arduino DUE. In addition to the single loop present in the standard Arduino approach, the user can easily specify a number of concurrent loops to be executed at specific rates. Concurrency and real-time scheduling is provided by the ERIKA Enterprise (http://erika.tuxfamily.org/drupal/) open-source real-time kernel. Loops can use the standard Arduino libraries, which have been enhanced to guarantee mutual exclusion in the access of shared data structures. The impact of ARTe in terms of footprint and runtime overhead has beed evaluated by extensive tests and resulted to be negligible. In this project was used to run 3 periodic processes that handle different activities. A process for managing every 3 seconds the acquisition of the distance through the sensor HC-SR04. Another process for flashing a LED every 7 seconds. A final process to read the temperature returned by the LM35 sensor expressed in degrees Celsius is executed every 11 seconds. All processes are managed in real time mode.

Multitasking and Real-Time Arduino Processing

arduino

This simple project shows how Arduino can be used with a real time operating system (Erika). A special version of Arduino called ARTe was used for software development ( http://retis.sssup.it/?q=arte ). ARTe (Arduino Real-Time extension) is an extension to the Arduino framework that supports multitasking and real-time preemptive scheduling. Thanks to ARTe, the user can easily specify and run multiple concurrent loops at differents rates, in addition to the single execution cycle provided by the standard Arduino framework. Today ARTE supports the most popular platforms: Arduino UNO and Arduino DUE. In addition to the single loop present in the standard Arduino approach, the user can easily specify a number of concurrent loops to be executed at specific rates. Concurrency and real-time scheduling is provided by the ERIKA Enterprise (http://erika.tuxfamily.org/drupal/) open-source real-time kernel. Loops can use the standard Arduino libraries, which have been enhanced to guarantee mutual exclusion in the access of shared data structures. The impact of ARTe in terms of footprint and runtime overhead has beed evaluated by extensive tests and resulted to be negligible. In this project was used to run 3 periodic processes that handle different activities. A process for managing every 3 seconds the acquisition of the distance through the sensor HC-SR04. Another process for flashing a LED every 7 seconds. A final process to read the temperature returned by the LM35 sensor expressed in degrees Celsius is executed every 11 seconds. All processes are managed in real time mode.

Downloadable files

Circuit Diagram

Electronic circuit of the components used. This schema has been designed to work properly with the implemented Arduino code. If the layout of the components is changed, you must change the pin statement in the Arduino code.

Circuit Diagram

Comments

Only logged in users can leave comments

Anonymous user

2 years ago

The site http://retis.sssup.it/?q=arte no longer has images, because the images have been moved away ... :(

Menphis

2 years ago

Unfortunately, the site is not up to date. But the Arduino Software version with ERIKA works well.

Menphis

2 years ago

The new site of ARTe Real-Time extension for Arduino is available on the following link: http://arte.retis.santannapisa.it/index.html

Anonymous user

2 years ago

Ok, thank you!

Anonymous user

2 years ago

The link (http://retis.sssup.it/?q=arte) is broken. Do you have another link to download ARTe?

frestucc

2 years ago

Hi. We are working hard for the porting to new IDEs, soon ARTe will be available for ARDUINO 1.9 beta!

Anonymous user

2 years ago

Thanks Melvin, however the site mentioned that it only support Arduino Due. I need to use it with UNO... Wonder if there is any possibility to use it with UNO

Menphis

2 years ago

I developed this project with Arduino UNO, so if you follow the instructions you should not have any problems. I don't know if the version of ARTe is changed after this work. I recommend you to use Window 8.1 because I tried to use old versions (7, XP) and the platform doesn't work.

Menphis

2 years ago

I have uploaded the ARTe application in the github project (https://github.com/melvin-mancini/Multitasking-RealTime-Arduino-System). You can use the Arduino IDE with ARTe extension running the file ARTe/work/arduino.exe. In the README file there are the instructions to run the Arduino IDE with the ARTe extension.

Menphis

2 years ago

The new site of ARTe Real-Time extension for Arduino is available on the following link: http://arte.retis.santannapisa.it/index.html

Anonymous user

2 years ago

have you find a solution to instal ARTe on windows 10 please ?

Anonymous user

2 years ago

Hi frestucc.... any update on using Arte on UNO. I tride installing from the link which Michael said....ya its broken. Thanks in advance for yr reply

Anonymous user

2 years ago

Thanks Melvin... I have Windows 10 and the arduino version given for UNO given from (http://retis.sssup.it/?q=arte) simply won't install on 10....looks like i need to look for 8.1 and give a shot.

Anonymous user

2 years ago

Hi. Ok. Thank you to answer me.

Anonymous user

2 years ago

Another interesting presentation here: http://www.betterembedded.it/media/conference/slides/real-time-multitasking-con-arduino.pdf

Anonymous user

2 years ago

Some installation hints "for dummies like me"@TM: - the complete Arduino development kit is there: http://retis.sssup.it/?q=arte - go to the "Dowload" tab and download the rar file - unpack the rar file in a folder - go to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html - download jdk-8u151-windows-i586 Java SE install package; it is VERY important that you install the 32 bit version; on my Win 10 PRO 64 bit other Java versions does not work for ARTe - go to the ARTe "work" folder and launch "arduino" or "arduino_debug" - configure the development system for your board and com port - do not forget to activate ARTe ! - test the installation running the example in "blinkuno_mod" folder Many thanks to Paolo Gai (Erika) and Alessandro Biondi (Java) support

Menphis

2 years ago

The new site of ARTe Real-Time extension for Arduino is available on the following link: http://arte.retis.santannapisa.it/index.html

Anonymous user

2 years ago

Thanks for you suggestion, that I can launch the IDE. However, when I try the demo program, there are errors. Do you have the same problem? Or how to solve it? In file included from sketch_feb01a.ino:3: C:\\Users\\JunjieShi\\Documents\\Arduino software\\work\\ee\\pkg/ee.h:50:19: error: eecfg.h: No such file or directory sketch_feb01a.ino: In function 'void setup()': sketch_feb01a:6: error: 'Alarmloop1' was not declared in this scope sketch_feb01a:6: error: 'SetRelAlarm' was not declared in this scope sketch_feb01a:7: error: 'Alarmloop2' was not declared in this scope sketch_feb01a:8: error: 'Alarmloop3' was not declared in this scope sketch_feb01a.ino: At global scope: sketch_feb01a:15: error: expected constructor, destructor, or type conversion before '(' token sketch_feb01a:24: error: expected constructor, destructor, or type conversion before '(' token sketch_feb01a:33: error: expected constructor, destructor, or type conversion before '(' token

Anonymous user

2 years ago

The link (http://retis.sssup.it/?q=arte) is broken. Do you have another link to download ARTe?

Anonymous user

6 years ago

This is a great feature!! It is not compatible with some libraries. for example the library ILI9341_due does not work. likewise it is a great contribution.

Anonymous user

7 years ago

The link (http://retis.sssup.it/?q=arte) is broken. Do you have another link to download ARTe?

Anonymous user

2 years ago

Thanks Melvin... I have Windows 10 and the arduino version given for UNO given from (http://retis.sssup.it/?q=arte) simply won't install on 10....looks like i need to look for 8.1 and give a shot.

Anonymous user

2 years ago

Hi frestucc.... any update on using Arte on UNO. I tride installing from the link which Michael said....ya its broken. Thanks in advance for yr reply

Anonymous user

2 years ago

Thanks Melvin, however the site mentioned that it only support Arduino Due. I need to use it with UNO... Wonder if there is any possibility to use it with UNO

frestucc

2 years ago

Hi. We are working hard for the porting to new IDEs, soon ARTe will be available for ARDUINO 1.9 beta!

Menphis

2 years ago

The new site of ARTe Real-Time extension for Arduino is available on the following link: http://arte.retis.santannapisa.it/index.html

Menphis

2 years ago

I developed this project with Arduino UNO, so if you follow the instructions you should not have any problems. I don't know if the version of ARTe is changed after this work. I recommend you to use Window 8.1 because I tried to use old versions (7, XP) and the platform doesn't work.

Menphis

2 years ago

I have uploaded the ARTe application in the github project (https://github.com/melvin-mancini/Multitasking-RealTime-Arduino-System). You can use the Arduino IDE with ARTe extension running the file ARTe/work/arduino.exe. In the README file there are the instructions to run the Arduino IDE with the ARTe extension.

Anonymous user

2 years ago

Hi. Ok. Thank you to answer me.

Anonymous user

2 years ago

have you find a solution to instal ARTe on windows 10 please ?

Anonymous user

7 years ago

Another interesting presentation here: http://www.betterembedded.it/media/conference/slides/real-time-multitasking-con-arduino.pdf

Anonymous user

7 years ago

Some installation hints "for dummies like me"@TM: - the complete Arduino development kit is there: http://retis.sssup.it/?q=arte - go to the "Dowload" tab and download the rar file - unpack the rar file in a folder - go to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html - download jdk-8u151-windows-i586 Java SE install package; it is VERY important that you install the 32 bit version; on my Win 10 PRO 64 bit other Java versions does not work for ARTe - go to the ARTe "work" folder and launch "arduino" or "arduino_debug" - configure the development system for your board and com port - do not forget to activate ARTe ! - test the installation running the example in "blinkuno_mod" folder Many thanks to Paolo Gai (Erika) and Alessandro Biondi (Java) support

Menphis

2 years ago

The new site of ARTe Real-Time extension for Arduino is available on the following link: http://arte.retis.santannapisa.it/index.html

Anonymous user

2 years ago

The link (http://retis.sssup.it/?q=arte) is broken. Do you have another link to download ARTe?

Anonymous user

2 years ago

Thanks for you suggestion, that I can launch the IDE. However, when I try the demo program, there are errors. Do you have the same problem? Or how to solve it? In file included from sketch_feb01a.ino:3: C:\\Users\\JunjieShi\\Documents\\Arduino software\\work\\ee\\pkg/ee.h:50:19: error: eecfg.h: No such file or directory sketch_feb01a.ino: In function 'void setup()': sketch_feb01a:6: error: 'Alarmloop1' was not declared in this scope sketch_feb01a:6: error: 'SetRelAlarm' was not declared in this scope sketch_feb01a:7: error: 'Alarmloop2' was not declared in this scope sketch_feb01a:8: error: 'Alarmloop3' was not declared in this scope sketch_feb01a.ino: At global scope: sketch_feb01a:15: error: expected constructor, destructor, or type conversion before '(' token sketch_feb01a:24: error: expected constructor, destructor, or type conversion before '(' token sketch_feb01a:33: error: expected constructor, destructor, or type conversion before '(' token

Anonymous user

7 years ago

The site http://retis.sssup.it/?q=arte no longer has images, because the images have been moved away ... :(

Menphis

2 years ago

Unfortunately, the site is not up to date. But the Arduino Software version with ERIKA works well.

Menphis

2 years ago

The new site of ARTe Real-Time extension for Arduino is available on the following link: http://arte.retis.santannapisa.it/index.html

Anonymous user

2 years ago

Ok, thank you!