Posts | Comments

Planet Arduino

Archive for the ‘multitasking’ Category

Apr
18

Energia Multitasking uses RTOS on MSP432

arduino hacks, ARM, Cortex M4F, energia, IDE, launchpad, msp432, multitasking, RTOS Comments Off on Energia Multitasking uses RTOS on MSP432 

We keep wondering where the Arduino world is headed with the hardware getting more and more powerful. If the IDE doesn’t keep up what’s the point? Now we have at least one answer to that problem. Energia is the Arduino-like-framework for Texas Instruments based boards. They just came out with a multitasking system built into Energia targeted at the ARM Cortex-M4F based MSP432 Launchpad which we covered a few weeks back.

The announcement post gives a couple of examples of uses for multitasking. The simplest is blinking LEDs at different rates. If you wanted to do this closer to the metal you’re talking about multiple timers, or multiple compares on a single timer, perhaps a interrupt-driven-system-tick that has a high enough resolution for a wide range of your blinking needs. But these are not always easy to set up unless you are intimately comfortable with this particular architecture. The Energia multitasking will handle this for you. It’s upon the TI Real Time Operating System (TI-RTOS) but wraped in the familiar IDE.

The UI divorces you from thinking about the hardware at all. You simply launch a new tab and start coding as if you’re using a completely separate piece of hardware. The announcement post linked above mentions that these Sketches are running “in parallel”. Well… we know it’s not a multi-core system like the Propeller but we’ll let it slide. It is certainly easier than building your own scheduler for this type of hardware.

[Thanks MycoWx]


Filed under: Arduino Hacks, ARM
Nov
06

Multi-tasking the Arduino

arduino, multitasking Comments Off on Multi-tasking the Arduino 

microcontrollers_IMG_5471

Make your Arduino walk and chew gum at the same time.

Once you have mastered the basic blinking leds, simple sensors and sweeping servos, it’s time to move on to bigger and better projects. That usually involves combining bits and pieces of simpler sketches and trying to make them work together. The first thing you will discover is that some of those sketches that ran perfectly by themselves, just don’t play well with others.

The Arduino is a very simple processor with no operating system and can only run one program at a time. Unlike your personal computer or a Raspberry Pi, the Arduino has no way to load and run multiple programs.

That doesn’t mean that we can’t manage multiple tasks on an Arduino. We just need to use a different approach. Since there is no operating system to help us out, We have to take matters into our own hands.

Multi-tasking the Arduino - [Link]

Dec
11

Avr OS on Arduino

arduino, avr os, gallery, multitasking, os Comments Off on Avr OS on Arduino 

What about an OS to run on your Arduino? Ok not in the way big os, remember Arduino has limited performance, but some of the basics, like spinlocks/multitask can be integrated with the AVR Os. As you know Arduino uses an AVR Compilant Processor, so its easy to port the code. The user [chris] sent us the way to do it, with also a simple sketch to print the classic “Hello World”.

avr-os is a library that provides a very basic rutime that enables your program to multitask.
The library uses pre-emptive multitasking to switch tasks and each task has its own stack that is restored when a task is resumed. An AVR timer is used to provide ticks and this interrupt is used to switch tasks.

All the instructions and the code to do it is stored at the [website]



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook