Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Introduction to microcontrollers (G. Gridling, 2006).pdf
Скачиваний:
223
Добавлен:
12.08.2013
Размер:
1.64 Mб
Скачать

2.4. ANALOG I/O

51

generally offers one or more different gains, but possibly not for all channels. The resulting output code for gain G is given by

$

V·

 

GND

·

%

 

 

G

(V+ − V)

 

2r−1 + 0.5 ,

(2.6)

 

 

 

 

 

ref

 

 

 

 

where G · (V+ − V) [−Vref /2, Vref /2].

2.4.4Exercises

In the following exercises, we assume that GND = 0V.

Exercise 2.4.1 Assume that you have an 8-bit ADC with Vref = 5V. What is the granularity of the converter (1 lsb)?

Exercise 2.4.2 Assume that you have an 8-bit ADC with Vref = 5V. Which input voltages are mapped to the code word 0x00? Which voltages are mapped to 0xFF?

Exercise 2.4.3 Assume that you have an 8-bit ADC with Vref = 5V. If the input voltage is 3.5V, what is the resulting code word?

Exercise 2.4.4 Assume that you have an 8-bit ADC with Vref = 5V and bipolar operation. If the inputs are V+ = 1V and V= 2V, what is the resulting code word? What is the resulting code word if we use unipolar mode?

Exercise 2.4.5 You have an 8-bit ADC with Vref = 5V and a differential input channel. The positive input voltage V+ is in the range [0.99, 1.03]V, the negative voltage Vis within [1.02, 1.025]V. What is the input range of the resulting differential input? What percentage of the full input range does that cover? How large is the quantization error, in percent of the differential input range?

Exercise 2.4.6 Consider the previous exercise. If the ADC offers the gains {2, 5, 10, 20, 50, 100, 200}, which gain would you select? How does your selected gain affect the quantization error (again in percent of the differential input range)?