Re: How much percentage of CPU time is wasted due to interru
Hi,
I think that answer depends on the main program organisation.
If you have only one process e.g main idle loop and one ISR (interrupt service routine) you don't waste anything. On every interrupt you execute ISR processing data and going to idle and wait for new interrupt.
Interrupt rate need to be less than worst case ISR execution time!
If you have more than one process interrupt lattency depends on the program organisation and structure of the ISR and dependacy of the data between ISR and other processes.
If you use different register bank and memory variables for ISR and other processes you don't need to put so many variables on the stack and you have shorter ISR lattency.
Best way to save CPU time is to make ISR short as possible using different register bank, global varables and optimized code, grab appropriated data and put it to appropriated FIFO buffer and process in the separate process in the main program loop.
Final solution depends on your register and memory requirments, avaliable stack size, CPU speed and real-time requirments.
Sometimes you can significant improved ovreall performances with some additonal hardware.
For high speed interrupt rates (8KHz) you need speed CPU and very short and optimized highest priority ISR. My recomendation is to reduce if it is possible interrupt rate with additional hardware or use separate controller to process these interrupts.