Go Down

Topic: DuinOS: small and simple rtos (Read 51 times) previous topic - next topic

juliandasilva

Hi, thanks for your kindly comments!
The maximun tasks that can be running simultanously depends on what they are doing. We are testing these kind of things now, but I think in a few days will be uploaded the full IDE so you could run your own tests, and tell us (thanks in advance! :)).  By now, I can tell you that the system interrupt tick is at 1 KHz.

In addition, as it's based on FreeRTOS, in the bigger CPUs (like the 644, 1280, etc.), you can enable the mutexes, semaphores, and even the lighter coroutines. We didn't encapsulate these, because think that in the more advanced applications that will use them, perhaps the programmer will prefer to access the FreeRTOS API directly.

Regards,
Julián

mem

Hi Julián, I wonder how much time a typical context switch takes. If it is many microseconds than the 1 ms interrupts could affect the servo library. Have you tested with that library?

juliandasilva

mmm, good point. I will run a test with a servo these days.
Thanks!
Julián

mem

its not just servos that may be affected by a context switch. pulseIn readings may also be affected. I would be interested to know how long the context switch takes.

juliandasilva

I was looking the servo and pulsein, although I could not make tests today. The servo library will have a conflict with the kernel, but I just added to the list of things to modify (as done with the delay() function). The problem is not a big problem: the current library uses the timer 1.

Regarding the pulseIn, I have two comments:

1. The kernel has CRITICAL_SECTIONS, so computation-intensive routines could be used. I don't think this aproach is the better, when using a preemptive kernel for many reasons, but it is still out there.

2. We plan in our group to continue improving this, and one of the main things to do is to get a better integration with the Arduino environment as a whole. This will imply to modify or even rewrite some things. There are examples, of small boards with nice libraries which can manage servos, pwms, pulses and has multitasking. One of them has more than 10 years old an runs on a 1 MIPS old HC11 (@4 MHz in some versions). It's the HandyBoard, wich has multitasking running over a virtual stack machine (IC). So we think this is  possible in a near 16 MIPS AVR, but will surely demand some work.

Regards,
Julián

Go Up