On Tue, 25 Nov 2003 21:05:24 +0100, Peter Mueller wrote: Hi all,
I have the problem that I need two background tasks. The first task has a cycle time of 10 ms, the second one of 1000ms. In the second task I want to execute a complex algorithm taking much longer than 10ms. Therefore it is not possible to run both in a while(1) loop. One way to solve to problem would be to break the algorithm up into short chunks to be able execute the faster task in time, which I would not like to do (if possible). Is there a good way to solve this problem without an OS? Is there a simple scheduler available? Peter uC/OS-II is available for the MSP430. There are others but I am not familiar with their capabilities. uC/OS-II is a preemptive RT kernel, but the last time I looked it did not support cyclic timers. To work around that problem you could create 3 tasks; a timer task, a 10 ms task, and a 100 ms task with priorities descending in that order. The timer task (highest priority) would (re)schedule itself to run every 10 ms. It would wake up the 10 ms task each time it ran and would wake up the 100 ms task every tenth time it ran. The reason to use a seperate timer task is to keep it short so the 10 ms period accuracy is maintained. I realize this explanation is awkward but hopefully close enough to follow. I'm also sure others with have a number of reasonable suggestions. Regards -Bill Knight R O SoftWare