Interrupts Flashcards

1
Q

What is an interrupt?

A
  • an asynchronous signal to the processor indicating the need for attention (normally by hardware) or
  • a synchronous event in software indicating the processor the need for a change in execution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

ISR and IRQ?

A

ISR - interrupt service routine

IRQ - interrupt request (act of interrupting)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

RETI used when?

A

ISR execution completes -> Returning from interrupt

–> restores registers and sets I-Bit in SREG

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an interrupt source?

A
  • signal starting an interrupt
  • external = rising/fall ing edge
  • internal = timer fired , ADC completion, I2C, SPI
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an interrupt flag?

A
  • each hardware interrupt source has an associate Interrupt flag which is indicating that an intterupt occured
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the interrupt mask?

A
  • Identical bit set to interrupt flag
  • setting a bit here will trigger ISR (unmasking) if flag is set (enabing certain interrupt)
  • when bit is cleared (masked), ISR is not executed, even if flag register signals an interrupt
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the interrupt vector table?

A
  • location in memory with adresses of ISRs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

ISR Steps?

A
  • relevant registers are pushed on stack (saving processors context)
  • acknowleding the interrupt
  • restoring the processor context
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Example of an ISR definition (signal/interrupt). Explain difference=

A
  • void ISRname (void) _ attribute _((signal, used));
  • ‘used’ so that the compiler does not say function not used
  • “ISRname” is predefined by the Machine
  • interrupt (re-) enables interrupts on entry
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a race conditions?

A
  • Problems arising when using ISRs

- Situation where outcome varies depending on precise order in which instructions of main code and ISR are executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a critical section?

A

Code that must be executed without interruptions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Example of an atomic access block?

A

Non-nested:
cli();
do_stuff();
sei();

For nested interrupts:
uint8_t sreg = SREG;
cli();
do_stuff();
SREG = sreg;
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Definition: Time triggered system

A
  • all activities are carried out at a certain point in time
  • no interrupts except by timer
  • schedule computed off-line (algorithms)
  • deterministic behavior at run time
  • interaction with environment through polling (con, critical aspect)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly