Why Does the Microcontroller Delay in Calling Address 0004h?

  • Thread starter Thread starter MSI
  • Start date Start date
  • Tags Tags
    Time
Click For Summary
SUMMARY

The discussion centers on the latency observed in microcontroller instruction execution, specifically regarding why the microcontroller does not directly call the address "0004h" during the third machine cycle after an interrupt request. Key factors include the presence of instruction pipelining, which complicates immediate execution halts, and the necessity of saving data such as status flags before switching execution threads. The conversation highlights that while the microcontroller can flush the instruction at PC+1, additional latency may occur if PC+1 is a function call.

PREREQUISITES
  • Understanding of microcontroller architecture
  • Knowledge of instruction pipelining
  • Familiarity with interrupt handling mechanisms
  • Basic concepts of machine cycles and program counters
NEXT STEPS
  • Research microcontroller instruction pipelining techniques
  • Study interrupt handling in specific microcontroller models
  • Learn about the implications of function calls on execution latency
  • Explore the architecture of the specific microcontroller discussed
USEFUL FOR

Embedded systems engineers, microcontroller developers, and anyone interested in optimizing interrupt handling and instruction execution in microcontroller applications.

MSI
Messages
16
Reaction score
1
http://img521.imageshack.us/img521/6018/msi7cv.jpg

this graph shows a latency time diagram when an inturept request occur in a micro controller ..
i was just wondering why doesn't the micro controller in the third machine cycle call the address "0004h" directly ?
whats the use of this cycle ? ... still the micro controller can flush inst (PC+1) ,, while fetching 0004h in the next cycle ? :/
 
Last edited by a moderator:
Engineering news on Phys.org
Couple of possible reasons. First, many CPUs have a pipelines instruction. The instruction at PC + 1 is probably already decoded and execution may be difficult to stop and more effective to just let it complete. Second, the cpu may have to save some data before allowing the thread of excution to jump to another thread, such at status flags.

To better answer he question would require significant knowledge of that particular processor.
 
well the second is not possibel , because saving the registers is done through the intrupt, and the first one .. yea it do pipelining (: , but it is already shown in the figer .. and if pc+1 is a calling function .. there will be extra latency (not shown in the figure) ..

anyway it is not a big deal (: , thanks
 

Similar threads

Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
10
Views
5K
  • · Replies 24 ·
Replies
24
Views
5K
  • · Replies 19 ·
Replies
19
Views
5K
  • · Replies 7 ·
Replies
7
Views
4K