Standard Single Purpose Processors: Peripherals Flashcards

1
Q

What can a Timer on a Microprocessor be used for?

A

Mesure time intervals, to generate timed output or to mesure input events.

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

Hoe do you calculate the CLK resolution?

A

Clk resolution = 1/Clk freq

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

What is the Clk range?

A

Clk range = time until overflow

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

What is TOP?

A

-indicates top count reached, wrap-around
- is connect to pin of processor or directly mapped to
interrupt flag

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

Draw a Basic timer!

A

See Chapter 5 Slide 4

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

Draw a basic Timer/Counter, or explain the difference to a basic timer

A

See Chapter 5 Slide 5
Counter: like a timer, but counts
pulses on a general input signal
rather than clock

Clk/Cnt Mode, TCNT, Reset, Top

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

What is a Timer with Terminal Count

A
▪ Timer indicates when desired time interval
has passed (up- or down-counter)
▪ Up-counter: Set terminal count to desired
interval but setting the value to which to count to
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Explain a Cascaded counter

A

Multiple counters connected in a row
2x 16 bit Can be configured for 32 bits

Frist counter reaches top, 2. counter is incremented by 1

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

What is a Prescaler, what is the purpose?

A
• Divides clock
• Prescaler output signal has reduced
frequency (1/2, 1/4, …, determined
by mode)
• Increases range, decreases
resolution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a Real-Time Clock (RTC)? What is the purpose?

A

▪ RTC: Clock keeping track of current time in human units
RTCs often
• have an alternate source of power (lithium battery, supercapacitor)
• use crystal oscillator with frequency 32768 Hz, i.e. resolution 30.52 µs
(overflow of 15 Bit counter after 1 second)

Purpose:
• Low power consumption (important when running from batteries)
• Frees main system for time-critical tasks

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

Explain Conventional Counters!

A

Count number of input cycle trigger events per second (called gate time)

Gate time not synchronized with input signal
• uncertainty of measurement is ±1 input
• cycle count, i.e. resolution is 1 Hz with
a 1 s gate time for all input signal frequencies

–> Counts for a fixed time persiode the numbers of signals

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

How do you Increase resolution for a Conventional Counters!?

A

Increase resolution with longer gate-times
• Gate time of 10 s increases resolution tenfold, adds one digit to read-out
• Resolution increases with frequency

–>Conventional counters
are bad for low-medium
frequencies and adequate
for high frequencies only

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

Explain Reciprocal Counting!

A

Input signal trigger controls start of gate-time
▪ Two counting registers: one counts number of input cycles and other counts the clock pulses

–> counts X numbers of signals and mesures time with clock

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

What is the advantage of Reciprocal Counting?

A

Resolution is independent of frequency

The ±1 input cycle error is avoided. Truncation errors are now in the time count; i.e. ±1 clock pulse

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

What is a Watchdog Timer (WDT)

A

Computer hard- or software timer that
triggers a system reset or other corrective action
if main program hangs (due to fault condition)
▪ WDTs are last line of defense against product failure
• If all else fails then let watchdog reset system

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

What is “feed the dog”?

A

Must reset timer every x time units (feed the dog), else WDT generates interrupt which resets program or jumps to save part

Code to feed the dog must be
• small and amount of system resources used, especially CP U cycles, must
be reasonable
• carefully integrated into software

17
Q

Most common usage of WDT?

A

Common usage is to detect:
• infinite loops
• deadlocks (if some lower priority tasks are not getting to run because higher priority tasks are hogging the CPU)
• general failures (e.g. in firmware) and timeouts

18
Q

Difference between the terms UART and RS -232

A

UART is peripheral on microcontroller which can send and receive serial
data asynchronously
• RS-232 is a signaling standard which mandates the logic levels and
control signals
• While AVR’s normal logic levels are about 3-5V, RS-232 communication
uses a low of +3V to +25V for a digital ’0’, and -3V to -25V for a digital ’1

19
Q

What are Standards for voltage signaling?

A

RS-232, RS-422 and RS-485

20
Q

Name the three minmal required wires for RS - 232.

when are only these used?

A
  1. transmit data (TX)
  2. receive data (RX)
  3. ground (GND)

Used when full facilities of RS-232 are not required

21
Q

When can a 2-wire connection be used? What are the wires?

A

2-wire connection (data and ground) can be used if data flow is one way (half duplex)

22
Q

What is a Asynchronous interface?

A

Transmitter and receiver clocks are independent, and a resynchronization is performed for each byte at the start bit

Typical usage:
Connect a PC for debugging

23
Q

What is a Synchronous interface?

A

Include separate clock signal line
• Simplifies transmitter & receiver, but is more susceptible to noise when used over long distances

• Examples:
Serial peripheral interface (SP I) and I²C
• Typical usage:
connect external EEPROM

24
Q

Explain UART and name one advantage?

A

UART: Universal Asynchronous Receiver
Transmitter
• Takes parallel data and transmits serially
• Receives serial data and converts to parallel

Adv:
• More cost effective than parallel transmission

25
Q

What dose UART usually consists of`?

A

a clock generator, usually a multiple of bit rate
to allow sampling in the middle of a bit period
• input & output shift registers
• transmit/receive control
• read/write interface

26
Q

What is required for a UART TX and RX?

A

Transmitting & receiving UARTs must have same values for bit speed (baud rate), number of data bits (word length), parity, and stop bits for correct operation

27
Q

Error types of USART?

A
Overrun error (DORn)
• indicates that a new data character was received before previous character was read. Data loss occurred
 Parity error (UPEn)
• set when parity of an incoming data character does not match expected value

Frame error (FEn)
• indicates a missing stop bit. This error can only happen when
• communication settings of transmitter/receiver (e.g. baud-rate) don’t match
• when connection was lost, or
• transmitter is faulty