Page 122 - Embedded Microprocessor Systems Real World Design
P. 122

If the supply voltage is used as a reference and the supply voltage is 5V, mea-
                  suring a 3V input would produce the following result:
                          Digital word = (Vin/Vref) x 255 = (3V/5V) x 255 = 15310 = 9g16

                  However, the result depends on the value of the 5V supply. If the supply voltage is
                  high by 1 percent, it has a value of 5.05V. Now the value of the A/D conversion will be:

                                        (3V/5.05V) x 255 = 15110 = 97,,
                  So a 1 percent change in the supply voltage causes the conversion result to change
                  by two counts. Typical power supplies can vary by 2 or 3 percent, so power supply
                  variations can have a significant effect on the results. The power supply output can
                  vary with loading, especially if there is any significant drop in the cabling that con-
                  nects the power supply to the microprocessor board. Thus, if your design needs all
                  the analog inputs and cannot use an external reference, be sure power supply vari-
                  ations will  not cause accuracy problems. One way  to minimize such errors is  to
                  power the measured signal from the microcontroller supply.

                  Resolution
                  The resolution of an ADC or DAC is determined by the reference input and by the word
                  width. The resolution defines the smallest voltage change that can be converted. As
                  mentioned earlier, the resolution is the same as the smallest step size and can be cal-
                  culated by dividing the reference voltage by the number of possible conversion values.
                     For the example we’ve been using so far, an &bit ADC with a 5V reference, the
                  resolution is .0195V (19.5mV). This means that any input voltage below 19.5mV
                  will result in an output of zero. Input voltages between 19.5 mV and 39 mVwill result
                  in an output of 1. Between 39 mV and 58.6 mV, the output will be 3.
                     Resolution can be improved by  reducing the reference input. Changing from
                  5V to 2.5V gives a resolution of 2.5/256, or 9.7mV. However, the maximum voltage
                  that can be measured is now 2.5V instead of 5V.
                     The only way to increase resolution without changing the reference is to use an
                  ADC with more bits. A 10-bit ADC using a 5V reference has 21°, or 1024 possible
                  output codes. Thus, the resolution is 5\3/1024, or 4.88mV.
                     The resolution also has implications for system design, especially in the area of
                  noise. A  O-to-5V,  10-bit ADC  with  4.88mV  resolution  will  respond  to  4.88mV
                  of noise just like it will to a DC input of 4.88mV. If your input signal has lOmV of
                  noise, you will not get anything like 10 bits of precision unless you take a number
                  of samples and average them. This means you either have to insure a very quiet
                  input or allow time for multiple samples.

                  Cumulative Accuracy
                  The accuracy of your ADC or DAC system is the cumulative accuracy of all the parts.
                  This means that the accuracy of your measurements (for an ADC) or output voltage


                  104                                             Embedded Microprocessor Systems
   117   118   119   120   121   122   123   124   125   126   127