How to start different task in one Programm

Hello new's group.
My MCU is a ADuC7026. It has only two interrupt priorities, FIQ is high priority, IRQ is normal priority.
I want to write a programm to generate some signals which are related to some sensor mesurements. Some of my cumputations are very resource killing. So this computations can only be performed not so often.
So there are different task.
The task with the highest priority has to be performed 200000 times per second. Another task with a middle priority has to be performed 25000 times per second. The next task with a mid-low priority has to be performed 2000 times per second. And one more task is to be performed 100 times per second. And the last task has to be performed 2 times per second with the lowest priority.

I hope i have explained this so someone can understand it. Of course maybe this is not the right Forum, but i use a keil compiler. My question is how can i programm all this different task without a operating system?
Sorry, i'm not very experienced... :-)

Parents
  • Why do it without an operating system?

    Anyway - you can not do it with the interrupts. They are not there to work as tasks, but to react to events.

    A superloop can do a lot of things, but it requires that all tasks can be splitted down into small enough steps that each turn through the loop runs at least as fast as the fastest task you need to handle. This would mean that the 2 times/second task has to be split into sub-steps each taking less than 5us.

    By the way: Have you started by making sure that the total computation time of all tasks are less than the total capacity of the processor? You need to have enough time left to handle interrupts and a bit of book-keeping and still have enough time left as safety margin for worst-case combinations.

Reply
  • Why do it without an operating system?

    Anyway - you can not do it with the interrupts. They are not there to work as tasks, but to react to events.

    A superloop can do a lot of things, but it requires that all tasks can be splitted down into small enough steps that each turn through the loop runs at least as fast as the fastest task you need to handle. This would mean that the 2 times/second task has to be split into sub-steps each taking less than 5us.

    By the way: Have you started by making sure that the total computation time of all tasks are less than the total capacity of the processor? You need to have enough time left to handle interrupts and a bit of book-keeping and still have enough time left as safety margin for worst-case combinations.

Children
More questions in this forum