Go Down

Topic: MULTITHREADING POSSIBLE IN ARDUINO BOARD (Read 8150 times) previous topic - next topic

Jun 28, 2014, 08:19 am Last Edit: Jun 30, 2014, 12:39 pm by dineshswami44 Reason: 1
IN ARDUINO MULTITHREADING POSSIBLE OR NOT?
possible then how to multithread ?

skullbucks


steinie44

Yes
Timeshare
Search for 'blink without delay'

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 ... 

kowalski

#4
Sep 14, 2014, 02:42 pm Last Edit: Sep 14, 2014, 02:58 pm by kowalski Reason: 1
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

Anwaarullah

I personally worked with scmRTOS's port for Arduino and liked it. It's seamless and a nice RTOS for getting started with.


The Arduino port is almost 2 years old and haven't seen much updates on it from the Author, but it works out of the box. Lemme know if anyone needs a copy of the Libraries.

NI$HANT

#6
Nov 04, 2014, 08:03 pm Last Edit: Nov 04, 2014, 08:03 pm by NI$HANT
personally worked with freeRTOS, chibiOS port for Arduino UNO (basically all the 8bitters supported by Arduino) and it works sweet.

If you are looking for some ultra sexy threading stuff then look towards ARM uC or more specifically the parallax propeller(certain uC's have 8 cores!!).
"Real Men can Accomplish  Anything"

- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੁਂ!

Go Up