- #1
PainterGuy
- 940
- 70
Hi,
I'd really appreciate it if you could help me with the queries below.
I think that the quoted text below at the bottom is a very simplified way of describing what happens when an interrupt happens. I believe that in reality the process would be more complex. The processor needs to store information from general purpose registers, ALU registers, and do many other dozens of things before it proceeds to Interrupt Vector Table or Interrupt Service Routine (ISR). ISR is also called Interrupt Handler.
Question 1:
I think that the order and number of activities any processor needs to perform before executing ISR would vary from one microcontroller to another. For example microcontroller 8051 might handle interrupts differently from PIC16f876. Please correct me if I'm wrong.
Question 2:
I'm sure each processor has a fixed set of hardwired instructions written somewhere which dictates it what to do when an interrupt occurs. What steps it needs to take every time an interrupt occurs before proceeding to ISR. I mean the processor should have some fixed set of instructions which tells which registers it needs to store first and in what order before it heads toward interrupt vector table or ISR. What are these instructions called and where are these stored? In some kind of firmware? Does a microcontroller such as 8051 have any firmware?
Question 3:
Where is the ISR stored is a microcontroller? Is it part of some kind of firmware?
Question 4:
Where can I find an estimated approximate time the processor takes before it addresses an interrupt? I mean how long it takes to store the currently executing instructions, store the information from registers, etc. I was trying to find this information for 8051 micronctroller.
Source: https://www.tutorialspoint.com/embedded_systems/es_interrupts.htm
I'd really appreciate it if you could help me with the queries below.
I think that the quoted text below at the bottom is a very simplified way of describing what happens when an interrupt happens. I believe that in reality the process would be more complex. The processor needs to store information from general purpose registers, ALU registers, and do many other dozens of things before it proceeds to Interrupt Vector Table or Interrupt Service Routine (ISR). ISR is also called Interrupt Handler.
Question 1:
I think that the order and number of activities any processor needs to perform before executing ISR would vary from one microcontroller to another. For example microcontroller 8051 might handle interrupts differently from PIC16f876. Please correct me if I'm wrong.
Question 2:
I'm sure each processor has a fixed set of hardwired instructions written somewhere which dictates it what to do when an interrupt occurs. What steps it needs to take every time an interrupt occurs before proceeding to ISR. I mean the processor should have some fixed set of instructions which tells which registers it needs to store first and in what order before it heads toward interrupt vector table or ISR. What are these instructions called and where are these stored? In some kind of firmware? Does a microcontroller such as 8051 have any firmware?
Question 3:
Where is the ISR stored is a microcontroller? Is it part of some kind of firmware?
Question 4:
Where can I find an estimated approximate time the processor takes before it addresses an interrupt? I mean how long it takes to store the currently executing instructions, store the information from registers, etc. I was trying to find this information for 8051 micronctroller.
Steps to Execute an Interrupt
When an interrupt gets active, the microcontroller goes through the following steps −
- The microcontroller closes the currently executing instruction and saves the address of the next instruction (PC) on the stack.
- It also saves the current status of all the interrupts internally (i.e., not on the stack).
- It jumps to the memory location of the interrupt vector table that holds the address of the interrupts service routine.
- The microcontroller gets the address of the ISR from the interrupt vector table and jumps to it. It starts to execute the interrupt service subroutine, which is RETI (return from interrupt).
- Upon executing the RETI instruction, the microcontroller returns to the location where it was interrupted. First, it gets the program counter (PC) address from the stack by popping the top bytes of the stack into the PC. Then, it start to execute from that address.
Source: https://www.tutorialspoint.com/embedded_systems/es_interrupts.htm