We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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... :-)
The problem with doing everything with interrupts, is that all interrupt handlers are expected to be fast.
As I read the description, some of the tasks are not really fast. Having nested interrupts may possibly solve some of the problems, but the overhead of having 227002 interrupts/s is extremely high.
What may be possible is - if we assume the processor is fast enough - to only run the quickest task (or the quickest two tasks) in an interrupt handler and then do the rest in a polled loop.
But a big problem is the allowed jitter for each task. Life is easier if several of the calculations can be merged, i.e. not doing 25000 evaluations/second for task #2, but instead do 5 calculations at a time, but only 5000 times/second. Obviously the same thing for task #1. Task #3 is slow enough that the interrupt overhead can be ignored. Task #4 is very suitable for a main loop.
But the cost of a very high interrupt frequency is the big reason why communications devices normally has FIFO support - it is too expensive to take an interrupt for each received (or to be transmitted) character. If an ADC is involved - is it possible to run it in auto-mux mode, where it may scan 4 or 8 separate inputs automatically and where the ISR can pick up multiple ADC values at each interrupt?