Analogue and Digital Input-Output Flashcards
What are the advantages of digital signals?
Accurate, good immunity to noise and signal degradation
Compatible with peripherals
For an n-bit ADC, what is the voltage resolution and voltage error?
Voltage res. = Vref/2^n
Voltage err. = Vref/2^n+1
Briefly explain how a successive approximation ADC works.
Analogue input is fed into circuit
Conversion logic starts with a guess of the voltage (in binary)
This binary is converted to analogue using a DAC and compared to the input voltage
Conversion logic increases/decreases the binary value and repeats until the input voltage is matched/is as close as possible
What limits the sampling rate of an analogue signal?
The ADC response time
What is aliasing and how is it prevented?
If an input analogue signal is sampled at a rate slower than the freq. of the signal, the reconstructed waveform appears to be of a lower freq.
Need to sample at a freq. at least 2 times more than signal freq. –> Nyquist theorem
What is the 1.1V internal voltage, why is it sometimes used, what limitations does it have and how are they overcome?
Generated internally by the microcontroller due to the physical nature of silicon.
It is sometimes used when measuring equipment is battery powered –> As battery voltage decreases, so will accuracy of ADC if using a Vref connected to battery, using 1.1V prevents this.
1.1V is stable with time and temp. BUT varies across a batch of chips by +/- 0.1V, o/p to a pin to be measure when system is built.
What are some sources of noise and error in a microcontroller, and how is it reduced?
Electromagnetic inteference
Gain error in comparator
Noise in Vref
Systematic error caused by inaccurate Vref
Clock edges –> can be switched off, reducing power consumption and local noise. Some can idle whilst conversion is occurring
How does a hardware debounce solution work? Draw a circuit diagram.
Resistor-capacitor circuit connected to Schmitt trigger which squares up waveform
Switch closed:
C discharges through resistor, R2 slows the voltage change.
Switch open:
Capacitor charges slowly through resistor.
R1, R2 & C smooth out the bounce when switch bounces
How does a software debounce solution work?
Hardware adds expense
Input is sampled several times over a defined time period, input is only considered to be stable if all samples are the same
What is pulse width modulation?
PWM switches a voltage on/off rapidly, the time spent high is called the duty cycle and is used to change the avg. voltage.
E.g. can be used to control a motor –> gives greater control over speed and allows motor to accelerate/decelerate.
What is the equation for the average voltage of a PWM?
Vav = D*Vhigh + (1-D)*Vlow D = duty cycle