Module 3 Flashcards
What are timers and their types?
Upcount mode
- Count up to a number in the ARR and then stop or repeat based on instructions
- When stopped, you can generate an interrupt for example.
- There is also then PWM mode, other useless stuff too these are the main two types.
What are two uses of PWM?
Dim the brightness of an LED by changing the Duty Cycle which in turn affects the average power delivered
Signals can be modulated using PWM waves
How does the basic DAC work?
There is a digital input and analogue output (duh) and there is a stable reference voltage for the output to look at
How does the PWM DAC work? ADV and DIS:
Use PWM through an amplifier and then an LPF with some cutoff frequency which then creates a crude analogue signal. This can be done with lookup tables to scale the voltage to some waveshape (sine, triangular, sawtooth) as required.
Advantages:
Cheap and easy to implement
Disadvantages:
Very crude and noisy signal based on the filter used.
How does the R2R Ladder DAC work? ADV and DIS:
It’s a resistance ladder that has as many branches as the resolution (bits) of the DAC. The voltages going in are digital (0V to 5V) for example from some sort of switching circuit.
Advantages:
Efficient - only need two resistors and can sil fab easily
Easily scalable
Output impedance only equal to R
Disadvantages:
Very temperature sensitive - inconsistent.
How does the Binary Weighted DAC work? ADV and DIS:
A set of resistors sent to the summing junction of an op-amp that either connect to digital high or digital low. The resistors are then weighted based on their values and what bits they represent.
Advantages:
Very fast conversion and simple to implement
Disadvantages:
Expensive to implement for high bit numbers and high precision resistors are needed.
What are the DAC performance metrics?
The ideal transfer function of the DAC is linear and passes through the origin (i.e. 0 input gives 0 output). There should be perfect 1-1 correlation between the step size in digital and the step size in analogue (meaning the step size is constant).
What is Hardware In The Loop
ES are often used in the loop of sampling an analogue signal, converting it to digital information, and then actuating another device based on the response to that information.
An example of HITL testing is using simulations to show how the subsystem will interact with the bigger system. Sims are often used because they are cheaper and carry a lower opportunity cost (you aren’t testing on the real product so breaking something isn’t an issue). It is also used because testing is highly repeatable.
What are some sampling concerns when working with HITL things?
Nyquist Sampling Theorem
- This says that sampling a signal with bandwidth B Hz must be done with a signal of frequency at least 2B Hz. This is needed as aliasing occurs at lower frequencies which is when samples overlap each other in the time domain. The signal is sampled too irregularly to recreate it properly.
Shannon’s Theorem
- This talks about the maximum capacity of a line and it’s ability to transmit information.
- C = BW * log_2(1+SNR)
Why is sampling done?
Sampled (digital) signals are easier to store than pure analogue waveforms, however, there is then the challenge in reconstructing the original. Interpolation formulae and sample and hold circuits are used.
What is an ADC
Takes some analogue representation from a counter into a DAC (or a SH circuit) and then translates it to some digital output.
How does the Flash ADC work? ADV and DIS
Very fast but expensive and power intensive. The solution to this is using the pipelined flash which is based on the SA-ADC.
The mulitstage flash works by using a SAH -> coarse ADC -> fine ADC
The pipeline then works by sending sample 1 to go through the coarse ADC and then to the fine ADC but as this happens another sample is sent to the coarse ADC
What is the SA-ADC and the Pipelined Flash?
The SA-ADC basically works on the principle of the binary search algorithm.
Set the MSB to one and compare
If its too big, then reduce the MSB
If its too small, set MSB-1 to one and repeat the procedure.
What are the ADC performance metrics - static errors?
Resolution
- The number of bits the ADC can produce
Quantization
- How the analogue voltages are mapped to a digital code
Static (DC) error
- This is the 0 input error. Basically, for 0 input we want 0 output but this often isn’t the case.
Gain error/Rotational
- How much the actual gradient deviates from the ideal dotted line
What are the ADC performance metrics - dynamic errors?
LSB error
- code relates to the step change between the measured voltage Vref (blue line) and the desired ideal transfer function (dotted line). The LSB accuracy may not be consistent for all codes; it may change for different Vrefs (e.g. get wider, a bigger jump, as the voltage increases).
Linearity (DNL)
- Basically the error in step size
Full Scale Error
- The last code is reached before the maximum voltage is reached.