Lecture 5: Digital Input Flashcards

1
Q

What is response time?

A

It is the time difference between the presentation of inputs and the receival of corresponding outputs.

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

What is the WCRT?

A

It is the Worst Case Response Time.

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

What is Jitter?

A

It is the difference between the worst and best case response times.

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

What is an interrupt?

A

A signal that will notify the CPU when an event occurs. Hardware mechanism will capture the input with Software using ISR to respond.

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

What are the advantages of Interrupts?

A

The CPU doesn’t need to waste time checking.

Faster response time because of this.

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

What are disadvantages of Interrupts?

A

Interrupts can occur at any time, making it more complicated to program.

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

What are the two main categories of interrupts?

A

Ones that are triggered by an event that sets an interrupt flag.
Ones that are triggered as long as the interrupt condition is present.

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

What does interrupt Priority depend on?

A

The architecture of the system.

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

On the ATMega8, which has higher priority, a lower or higher ISR vector address?

A

The lower vector address.

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

What happens if 2 or more interrupts occur at the same time?

A

The one with the highest priority will be dealt with first. The other ones will go onto a wait list in order of priority.

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

What is the procedure for handling an interrupt?

A
  1. The interrupt will occur.
  2. The current program will be stopped.
  3. Jump into the ISR Service routine.
  4. Save registers onto the stack -> this includes the current registers being used, the program counter and stack pointer.
  5. Execute code in the ISR
  6. Restore registers from the stack.
  7. Continue program execution from where the program was stopped.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

On the ATMega8, what are the locations of the 2 interrupts?

A

Pin 2 and 3 on register D.

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

How can we change whether or not the interrupt occurs on the rising or falling edge of the signal?

A

By changing bits in the MCUCR register.

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

What is interrupt latency?

A

It is the time between the event occurring and when the ISR is triggered.

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

What is interrupt response time?

A

It is a combination of the latency along with the execution time which is how long the ISR takes to execute.

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

What is the Foreground - Background approach?

A

Use the background as the infinite loop that performs the main functionality. The foreground is where the interrupts occur, we handle them with an ISR. Any critical events happen in the foreground but any long calculations should be passed to the background loop.

17
Q

When will the ISR get processed?

A

When the background loop reaches that specific point.

18
Q

What happens if the CPU takes too long to process an interrupt?

A

It will miss another interrupt.

19
Q

What can happen if the switch is too short?

A

It can cause something like switch debouncing where a mechanical switch can cause multiple interrupts.

20
Q

What is a critical section?

A

This is a piece of code that we don’t want to be interrupted so we disable interrupts for a small section.

21
Q

What is a software approach to mitigating the risk of switch debouncing?

A

When the switch is pressed, wait a certain period of time and see if the switch is still pressed. If it is then accept the signal and proceed to further execution. Generally the period that we wait will still be faster than what a human can press a switch.