FALLSEM2024-25 BEEE213L TH VL2024250101176 2024-08-07 Reference-Material-I
FALLSEM2024-25 BEEE213L TH VL2024250101176 2024-08-07 Reference-Material-I
Motivation
When the switch is closed, the circuit will sample the input by charging the
capacitor to the input voltage. Opening the switch disconnects the capacitor from
the input, so the circuit will hold the saved value of the input voltage for the ADC to
perform its conversion
Single ended vs., differential
This reduces the effects of noise. Some ADCs support differential signal
inputs.
These ADCs contain hardware that allows direct measurement of the voltage
difference, making conversion a single-step process.
• Two voltage references (V+ref and V–ref) are needed to define the
boundaries of the conversion range.
• Often the positive supply rail (e.g. 3.3V) is used as the positive reference and
ground is used as the negative reference
• Digital electronics work with binary values, so the number of discrete output
values is typically a power of 2. The resolution describes the number of bits
(B) used to hold the output value.
• For example, a code with eight-bit resolution has 256 possible output values.
• An output value n does not represent an exact voltage, but instead a range of
voltages
0.8
0.6
0.4
Amplitude(mV)
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 50 Hz Current Signature of a Lamp Load Fs=2048Hz
2.5
Time(s)
amplitude(V) 1.5
0.5
0
0 500 1000 1500 2000 2500
Time(sec)
ADC Pins
Multiple input channels
• The ADC module can perform sampling and conversions on a set of pre-defined
input channels in a round-robin fashion
• This conversion scheme is called scan mode. For a regular group, this mode
scans all channels defined in registers ADC_SQR1, ADC_SQR2, ADC_SQR3, and
ADC_SQR4
• The conversion operation can be set up to perform only once or repeatedly,
depending on bit CONT bit in the ADC_CFGR register
• However, for a regular group, there is only one data register that is shared by all
channels in this group
• Therefore, after each conversion in a regular group, the software needs to read
the data register between continuous sampling.
• An interrupt request or a DMA request can be triggered at the end of each
conversion if enabled. Thus, to reduce the software overhead, we often use the
ADC interrupt handler or the DMA controller to copy the ADC results to a user
buffer.
ADC pins
Data alignment
Next we will examine three applications of the ADC. Both use polling to
determine when the conversion is complete.
1. Voltage measurement
2. Temperature measurement
3. Multichannel ADC
4. Frequency measurement
ADC Trigger signal using Timer
Setting the ADC sampling sequence for regular channels
ADC with DMA