Pages: [1]   Go Down
Author Topic: MULTITHREADING POSSIBLE IN ARDUINO BOARD  (Read 5914 times)
0 Members and 2 Guests are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

IN ARDUINO MULTITHREADING POSSIBLE OR NOT?
possible then how to multithread ?
« Last Edit: June 30, 2014, 05:39:50 am by dineshswami44 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
Get more ideas Find the best modern, responsive, elegant and professional platform for your project.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

can u plz elaborate
Logged

Shelby Township, Disco, Michigan
Offline Offline
God Member
*****
Karma: 26
Posts: 766
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes
Timeshare
Search for 'blink without delay'
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Real Multithreading is not possible with uno,mega type of boards . only arduino due can have multithreading ... but i am not getting any example of multithreading on due ... 
Logged

Sweden
Offline Offline
Sr. Member
****
Karma: 11
Posts: 464
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No problems with this!

There are actually a few RTOS around that work on the Arduino Boards. Checkout fat16lib's porting of for instance ChibiOS. https://github.com/greiman?tab=repositories

But first let us step back and look at the hardware. In a broader sense multi-tasking is already going on even in the Arduino core. The AVR MCUs contain a number of hardware modules that can be run concurrently with the processor. Some examples; ADC, UART, SPI, TWI, Watchdog, Timer, etc.

In Cosa I have implemented several methods of achieving multi-threading; periodic functions, state-machines, proto-threads and coroutines. Below are links to example sketches;

https://github.com/mikaelpatel/Cosa/blob/master/examples/Blink/CosaBlinkPeriodic/CosaBlinkPeriodic.ino
https://github.com/mikaelpatel/Cosa/blob/master/examples/Blink/CosaBlinkFSM/CosaBlinkFSM.ino
https://github.com/mikaelpatel/Cosa/blob/master/examples/Blink/CosaBlinkProtoThread/CosaBlinkProtoThread.ino
https://github.com/mikaelpatel/Cosa/blob/master/examples/Blink/CosaBlinkThread/CosaBlinkThread.ino

The Cosa Nucleo (multi-threading) Blink example sketch uses three threads; LED that does the blink, Controller that changes the blink frequency, and the main thread that performs low-power sleep while waiting to the next time event. The sketch is possible to run on an ATtiny84 with only 512 bytes of SRAM.

Cheers!

Ref. http://forum.arduino.cc/index.php?topic=150299.0
« Last Edit: September 14, 2014, 07:58:03 am by kowalski » Logged

Pages: [1]   Go Up
Jump to: