Difference between revisions of "Interrupt"

From SEGGER Wiki
Jump to: navigation, search
(Created page with "In the context of Embedded Systems, and interrupt is an interruption of the program flow by hardware. Interrupts are widely used in almost all embedded Systems. Most Systems u...")
 
m (MartinBaldwin moved page Interrupts to Interrupt)
(No difference)

Revision as of 19:17, 2 May 2019

In the context of Embedded Systems, and interrupt is an interruption of the program flow by hardware. Interrupts are widely used in almost all embedded Systems. Most Systems use a timer to trigger a periodic interrupt so the system can keep track of its "up time", which is the time since start of the system, so the time after RESET. Another very common use of interrupts is for communication: When data is received, typically and interrupt is issued, causing the CPU to jump into the Interrupt Service Routine (ISR) handling the received data. This is a scheme used for almost all data, regardless of whether it is a single byte (such as in the case of a UART), or a packet, such as for Ethernet or CAN.

How interrupts are handled on different CPUs is very different on different architectures. Typically, Interrupts are disabled at program start. They first need to be enabled, typically in 3 places: The CPU has a general Interrupt-Enable (or Disable) Flag. So interrupts need to be enabled in general. The peripheral which is supposed to generate an interrupt needs to be "told to do so". And the interrupt controller, which is also typically part of the CPU, needs to also be "told to" enable this particular interrupt. Most modern CPUs come with an Interrupt vector table.

How interrupts are handled Interrupt are handled in Interrupt Service Routines