Timer Counters, Serial Data incl SPI Flashcards

1
Q

What are the basic functions of a counter?

A

To count based on the comparison of input signals.

To generate pulses based upon inputs and register values.

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

What is Pulse Width Modulation?

A

An approximation of analogue output.

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

What are the main applications of Counter/Timer?

A

PWM.
Generating a frequency (tone).
Counting high frequency pulses.

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

Describe PWM.

A

TCNTn starts at zero and increases upon every clock signal on input to the counter.
The value in the counter register TCNTn increases continuously until it equals the value in the Output Compare Register.
The output which was previously high now switches to low.
The counter carries on increasing, even though the output is now low, until the counter contains the maximum value it can.
When the counter hits the maximum value it wraps back around to zero, setting the output high and it starts again.
The larger the number placed in the OCR, the longer the output stays high.

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

How does a counter generate a frequency (tone)?

A

TCNTn starts at zero and increases upon every clock signal on input to the counter.
The value in the counter register TCNTn increases continuously until it equals the value in the Output Compare Register.
When it reaches this value it swaps the state of the output pin ans resets TCNTn to zero.
If the value in OCR is large, a low frequency is generated as there is a long time between the changes of state of the output pin.
If the value in the OCR is small, a high frequency is generated as there is a short time between the changes of state of the output pin.

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

How does a counter count high frequency pulses?

A

A counter can generate pulses up to 1MHz.
Every pulse increments the counter by 1.
A high frequency signal would cause the counter to wrap around very quickly.
Every 65536 pules the counter wraps around to zero.

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

What is the difference between series and parallel data transfer?

A

Parallel data transfer involves transferring all 8 bits simultaneously.
It needs 8 wires plus ground.
Parallel data transfer is OK for short distances but impractical for long distances due to having lots of wires.
Series data transfer involves transferring 1 bit at a time.
It only needs 1 wire plus ground.

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

Describe Serial Peripheral Interface.

A

One master device can communicate both ways with multiple slave devices.
There are 3 common wires between all slave: MOSI, MISO, Clock.
To communicate with a slave, select it by making its slave select line low.

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