2 SoftwareSerial instances, Multitasking, FreeRtos

This might seem like a very broad question but that's what i want it to be for multiple ways of implementation.

I've an Arduino UNO communicating with 2 Serial devices interfaced using SoftwareSerial flawlessly. I've used [SS_Object].listen() function to switch between the two. Right now, the entire code works sequentially meaning that, once it's work with the 1st Serial device is done, only then it will switch to the 2nd Serial device and work with it. Can i communicate with the 2 in parallel (Multitasking) using FreeRtos? I've heard that the scheduler switches between tasks when it encounters a delay. So may be a small useless delay is required, only for the scheduler, to switch between the two. May be! or May be things will be better if i use more advanced Arduino like Mega or Due.

Thanks for taking your time to read this. Please answer the question the way you've understood it as i am sure different people with different experiences will interpret this differently.

Thanks in advance!

kushal_kqb: May be things will be better if i use more advanced Arduino like Mega or Due.

Yes indeed.

If you need to do more than one thing at a time have a look at Several Things at a Time

I don't reckon there is any chance of using SoftwareSerial the way you want - it is very basic and really only suitable for one-at-a-time usage. For what you need use an Arduino with multiple HardwareSerial ports.

You may also be interested in Serial Input Basics

...R

Can i communicate with the 2 in parallel (Multitasking) using FreeRtos?

No, Arduino's are single core processors. True parallel Multitasking can only happen on multicore processors.

FreeRtos is similar to the scheduler in that it also switches from 1 task to the next.

I haven't used it, but I don't see many people using FreeRtos here. My guess is it because it wastes valuable program space. and it is not hard to accomplish the same thing without it.

the delay() function is the real time killer. Learn to avoid it by using timing code as in the Blink Without Delay example.

With proper coding techniques the Arduino can switch between task's fast enough that they appear simultaneous to human senses.

More Info: Demonstration code for several things at the same time Multi-tasking the Arduino - Part 1

I don't reckon there is any chance of using SoftwareSerial the way you want - it is very basic and really only suitable for one-at-a-time usage. For what you need use an Arduino with multiple HardwareSerial ports.

I agree with this. A Mega would work much better because of the multiple Hardware Serial ports

Use a Mega.

Hutkikz:
True parallel Multitasking can only happen on multicore processors.

No.

There is a big difference between multitasking and multiprocessing.

Whandall: There is a big difference between multitasking and multiprocessing.

I was quoting the OP's words. He used " PARALLEL multitasking" but was really describing multiprocessing which the Arduino cannot do.

Good article tho.