ADC

ADC

by Dr. Dickson Mugerwa -
Number of replies: 0

Attempt these on paper first. Use Vref = 3.3 V, the values in Table 1 and the formulas in Section 7 unless a question says otherwise. Full answers are in the Appendix.
Part A  Concepts
A1.    Define an analog signal and a digital signal, and give one example of each.
A2.    Why must a microcontroller use an ADC to read a light sensor?
A3.    What does “12-bit resolution” mean? State the number of levels, the output range and how 0 V and 3.3 V are mapped.
A4.    Name the four ADC conversion modes and state in one line what makes each different.
A5.    You must read three sensors connected to three ADC channels. Which conversion mode is suited to this, and why?
A6.    State two differences between reading the ADC by polling and by interrupt.
A7.    Explain each argument of HAL_ADC_PollForConversion(&hadc1, 100). What does the function return if the conversion does not finish in time?
A8.    List four real-world applications of light sensors.
A9.    Why should a 5 V signal never be connected directly to an STM32 ADC input?
A10.    A 6-bit conversion needs fewer ADC cycles than a 12-bit conversion. Why might you still prefer 12 bits?
True or false?
T1.    In single conversion mode the ADC keeps converting until it is stopped.
T2.    The output of a 12-bit ADC ranges from 0 to 4095.
T3.    With everything else unchanged, a higher ADC clock frequency gives a shorter conversion time.
T4.    In interrupt mode, HAL_ADC_GetValue is normally called inside the callback.
T5.    In the phototransistor circuit, if the photocurrent doubles then Vout halves.
Part B  Calculations
B1.    For an 8-bit and a 10-bit ADC with Vref = 3.3 V, find the number of levels, the highest output code and the step size.
B2.    A 12-bit ADC returns the value 3000. What is the input voltage?
B3.    A 10-bit ADC has an input of 0.8 V. What value does it return?
B4.    A light sensor gives Iph = 250 µA through RL = 8.2 kΩ. Find Vout and the expected 12-bit ADC value.
B5.    The maximum photocurrent is 500 µA. Find the largest RL that keeps Vout within 3.3 V, and pick a standard value from the E12 series (…, 4.7, 5.6, 6.8, 8.2, 10, … kΩ) that does not exceed it. State Vout,max for your choice.
B6.    APB2 = 84 MHz and the ADC prescaler is 4. The ADC is in 12-bit fast mode (15 cycles) with a sampling time of 28 cycles. Find the ADC clock, the conversion time and the maximum sampling rate.
B7.    The ADC clock is 10.5 MHz, the mode is 12-bit fast (15 cycles) and you need Tconv of at least 15 µs. Find the sampling time required, then choose the nearest available value from 3, 15, 28, 56, 84, 112, 144 and 480 cycles that meets the requirement, and state the resulting Tconv.
B8.    A program must switch on a lamp when Vout falls below 0.5 V. What 12-bit ADC threshold should it use?
B9.    What is the maximum quantisation error (± ½ LSB) of a 12-bit ADC with Vref = 3.3 V?
B10.    A student changes the ADC from 12-bit to 8-bit. By what factor does the step size change, and what are the two step sizes?
B11.    Challenge. With RL = 10 kΩ, the reading of a light sensor rises from 1200 to 2400 (12-bit) when a torch is brought closer. Find the two photocurrents. What do you notice?