Tutorial 6 ADC solutions PDF

Title Tutorial 6 ADC solutions
Author Ali Salimy
Course Digital and Programmable Systems 2
Institution Glasgow Caledonian University
Pages 3
File Size 155.2 KB
File Type PDF
Total Downloads 98
Total Views 146

Summary

Analogue to Digital Conversion tutorial answers...


Description

M3H623544 Digital and Programmable Systems 2

Tutorial 6 – Analog to Digital Conversion

1. Summarise the basics of Nyquist’s sampling theorem, and explain what happens to a captured signal if the signal is undersampled. The sampling frequency fS must be at least twice the maximum frequency component in the analog signal to be sampled. If the signal is undersampled, frequency components fi above half the samling frequency will produce fake data at a frequency under fS/2 that is not possible to tell from a real one (an alias). This is known as aliasing. To be sure that aliasing will not happen, fS must be must be much higher than the maximum frequency expected in the input (but sometime this can not be known). The safe approach is to use an analog low-pass filter on the analog input BEFORE sampling, using a cut-off frequency just under fS/2, to eliminate frequency components over fS/2 and guarantee that they will not appear as alias.

2. If the input range of a 12 bit ADC is 0V to 2.5V, determine the voltage resolution of the converter. Resolution = range / 2n = (2.5 – 0)/212 = 0.00061 V/bit =0.61 mV/bit

3. Determine the associated quantisation error for the ADC converter in question 2 if the input value to be converted is 1.54V. The closest value using the 0.61mV resolution is: 1.54/0.00061 = 2523.136  2523 The quantization error is then 2523.123 – 2523 = 0.123, that corresponds to a voltage of 0.123*0.00061=83 µV

4. Explain the purpose of oversampling in terms of noise improvement and calculate the SNR improvement for a 12bit ADC when a signal is oversampled by a factor of 8. Oversampling at k.fS (k>1) spreads the quantification noise in a wider range of frequencies (k times wider), reducing the average noise level and thus improving the signal-to-noise ratio in the digital signal. The expression for a single frequency signal (pure sinusoidal wave) is: SNR = 6.02n +1.76 + 10 log(k/2) dB So the improvement by oversampling at k=8 is +10 log(k/2) = +10log(4)=+6 dB

5. For the 12 bit ADC converter in the MSP430 how is the ADC core enabled? The ADC hardware module must be switched on by setting bit ADC12ON. Once configuration is finished, the ADC operation must be enabled by setting bit ADC12ENC. Both bits are inot control register ADC12CTL0.

6. For an MSP430 12 bit ADC, V+ = 2.5V, V- = 0. If Vin = 1.2V what is the binary format of the converted voltage? Resolution = (2.5-0)/212. The converted value is 1.2V/resolution = 1.2 x 212 / 2.5 =1966 = 0111 1010 11102= 0x7AE

7. Four of the ADC input channels are used for special purposes in the MSP430. What are these channels and what are their purpose? A11 = Battery volt monitor A10 = in-built Temp sensor A8, A9 = external reference voltages VeR+ , VeR-

B G Stewart / M Mata

page 1

M3H623544 Digital and Programmable Systems 2

8. If the internal temperature of the MSP430 board is 40oC determine the input voltage to the MSP430 temperature ADC input channel. The transfer function (with T in oC) is VTemp = 0.00355 x T + 0.986 [V] So VTemp(40oC)= 0.00355*40 + 0.983 = 1.125V However local calibration data stored by the manufacturer in Flash should be used since it provides more precise results for each MSP430 device

9. What happens when the ADC12SC in the ADC12CTL0 register is written with a “1”? If the ADC converter is ON and conversion is enabled (see question 5), it will start a conversion (single or repeated depending on the conversion mode selected)

10. There are four possible operating modes of the ADC converter in the MSP430. Summarise these four modes The 4 modes are: - single channel, single conversion: a software or hardware conversion trigger provokes a single conversion on the selected channel. No conversons will happen until a new trigger is applied - single channel, repeat conversion: a software or hardware conversion trigger provokes a conversion on the selected channel; new conversions are continuously started without the need of a new triggering - sequence of channels, single conversion: a software or hardware conversion trigger provokes a single conversion on the selected channel, and all the channels from it util A0 (one channel at each time as there is a single ADC conversor). No conversons will happen until a new trigger is applied - sequence of channels, repeat conversion: a software or hardware conversion trigger provokes a single conversion on the selected channel, and all the channels from it util A0 (one channel at each time as there is a single ADC conversor). New conversions are continuously started without the need of a new triggering 11. The ADC12INCHx field in the ADC12MCTLx register is set to 0110b and the ADC12CONSEQx field is set to 01b. What does this mean? Selected input channel is 0110b=6 so A6. 01b in ADC12CONSEQx means “sequence of channels” so a single conversion of the channel range A6, A5, …, A0 will be performed when the conversion is enabled and triggered. 12. The 12 bit ADC resolution setting in the MSP430 is to be changed from 12 bits to 10 bits. How is this achieved? What is the purpose? This is done by setting the ADC12RES bits to 01b (in control register ADC12CTL2). This reduces resolution but also reduces ADC conversion time (from 12 clock ticks at 12 bits resolution to 11 clock ticks at 10 bits resolution) 13. Outline the basic programming steps for a single channel 12 bit ADC capture in the MSP430. -Either connect appropriate reference voltage sources to ADC12 converter’s pins A8 and A9 and/or program ADC12SREFx bits in ADC12MCTLx registers to use internal references -Connect analog signal to convert to one of the input pins (A0-A7, A12-A15), say A0 -Turn on ADC converter: ADC12ON in ADTCTL0 -Select clock source, sampling mode, and trigger source (software or timers) B.G. Stewart / M. Mata

page 2

M3H623544 Digital and Programmable Systems 2

-Configure converter operation mode to single channel (ADC12CONSEQx bits = 00b in ADCTL1 -Enable conversion: ADC12ENC bit in ADC12CTL0. If using software triggering, initiate it with bit ADC12SC in ADTCTL0 -Conversion completion sets ADC12IFG flags and ADC12IV value (or, if not using interrupts, wait for bit ADCBUSY in ADCTL1 to be 0) -Then use results of the conversion located in the corresponding result register (ADC12MEM0 for channel A0)

B.G. Stewart / M. Mata

page 3...


Similar Free PDFs