Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How much percentage of CPU time is wasted due to interrupt?.

Status
Not open for further replies.

Bella

Newbie level 6
Newbie level 6
Joined
Dec 22, 2003
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
90
The processor can execute 10 lakh instructions/second. An interrupt has a overhead of 20 instructions. Assume an interrupt rate of 8 KHz. How much percentage of CPU time is wasted due to the interrupt?.
 

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.
 

Re: How much percentage of CPU time is wasted due to interru

OK if I undestand it correctly:

CPU = 10 mips.
INT latency = 20 cycles (instructions)
INT rate = 8000.

wasted cpu cycles (%) = ( 20 * 8000 / 10.000.000 ) * 100% = 1.6%

So you loose 1.6 % due to the interrupt rate of 8Khz.. This is still a low interrupt rate since I have designed systems with interrupt rates of 64000/sec. on a normal PIC :).

regards,

Paul.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top