Microcontrollers Flashcards

(16 cards)

1
Q

Data Direction Register (DDR)

A

 read/write

 specifies for each bit of the corresponding port whether it is an input or an output bit

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

Port Register (PORT)

A

 read/write
 specifies for the output pins whether the output value is high or low
 ATmega16: also used for controlling pull-up resistors for input pins (see next slides)

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

Port Input Register (PIN)

A

 read only (writing has no effect or unintuitive semantics)
 contains the current value (high or low) of all pins (input and output)
 usual purpose: reading values of input pins

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

LED: Digital Output

A
PORT = logic 1 -> VCC 
PORT = logic 0 -> GND
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Polling

A

 Periodically check for event
 Disadvantages:
• Waste of CPU time if the event occurs infrequently
•Polling sequence has to fit in the rest of the code (hard to modify or extend)

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

Interrupts (IRs)

A

 MCU polls the signal and interrupts the main program if a state change is detected.
 MCU calls an interrupt service routine (ISR) which handles the event

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

ISR is triggered by event

A

 Save return address (PC) to stack
 Clear global interrupt enable bit (I bit)
 Clear interrupt flag bit (usually)
 Jump to corresponding interrupt vector table entry (interrupt vector)

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

(Interrupts vs Polling) Interrupts is better if

A

 Event occurs infrequently
 Long intervals between two events
 The exact time of the state change is important
 Short impulses, polling might miss them
 Nothing else to do in main, could enter sleep mode

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

(Interrupts vs Polling) Polling is better if

A

 No precise timing is necessary
 The state is important
 Impulses are long
 The signal is noisy (Interrupts would be triggered very often)

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

Counter

A

 counts external events

 e.g. number of rising edges at PINB2

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

Timer

A

 counts clock cycles (with or without prescaler)

 Each timer is basically a counter

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

Input capture

A
  • Used to timestamp (mostly external) events

* Whenever the event occurs, the timer automatically copies its current count value to an input capture register

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

Output compare

A
  • Used to generate signals
  • Whenever a certain timer value is reached, the output compare event is triggered (can automatically set or clear an output line).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Pulse Width Modulation (PWM)

A
  • Special case of output compare

* Timer generates a periodic digitaloutput signal with configurable high-time and period.

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

DAC

A

 RC low-pass filter
 Binary weighted resistor circuit
 R-2R ladder

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

ADC

A

 Simple: Analog Comparator
 Flash Converter
 Tracking Converter
 Successive Approximation Converter