120/317
5 - Peripherals
criterion, that states the shape of the curve that relates the closed-loop gain with the phase
shift. These parameters depend on the gain and phase shift of all of the components of the
system, including the ADC. The local gain of the converter is the slope of the conversion
curve. This value is given by the ratio between the actual height of the step and its theoretical
height. This number is either greater or less than zero, depending on the point considered.
This local gain multiplies the total loop gain, and thus may greatly affect it. Thus there may be
some points where the gain is too high to meet the Nyquist criterion, leading to instability at
these points.
Generally speaking, implementing a numeric servo loop requires very high resolution and lin-
earity, combined with a short conversion time. This means an expensive converter, and will be
outside the range of the ST7 ADC unless the application just needs a servo loop but does not
need high performance.
5.6.4 Using the ADC to convert positive and negative voltages; increasing its resolution
5.6.4.1 Measuring negative and positive voltages
There are two ways of handling both positive and negative voltages with a converter that can
only handle positive voltages.
The first way is to amplify or attenuate the signal and to shift it by adding a fixed DC voltage so
that when it varies within its whole range, the ADC is fed with a voltage between zero and V
DD
(that is 5V in most cases). Then, when reading the ADCDR register as an unsigned value,
subtracting the DC offset yields a signed number that is zero when the signal to read is zero.
This method is simple, but it reduces the resolution since the whole signal range must fit the
256-value range of the converter.
05-adc1
V
ana
∈[
-V
DDA
/2, +V
DDA
/2
]
Offset = +V
DDA
/2
ADC
ADCDR
Conversion result =
signed byte (ADCDR + 128)
V
in
Measuring relative voltages using an analog offset
Analog
input
Содержание ST7 Series
Страница 1: ...ST7 8 BIT MCU FAMILY USER GUIDE JANUARY 1999 1 ...
Страница 238: ...238 317 8 C Language and the C Compiler 08 Burn bmp Then use the EPROMer programmer software as described in Chapter 7 ...
Страница 289: ...289 317 10 Second Application a Sailing Computer 10 befor Bs Rw Vw VMG AlphaR AlphaV Before the wind ...