cop8ame9 National Semiconductor Corporation, cop8ame9 Datasheet - Page 53

no-image

cop8ame9

Manufacturer Part Number
cop8ame9
Description
8-bit Cmos Flash Microcontroller With 8k Memory, Dual Op Amps, Virtual Eeprom, Temperature Sensor, 10-bit A/d And Brownout Reset
Manufacturer
National Semiconductor Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
cop8ame9EMW8/NOPB
Manufacturer:
National
Quantity:
172
15.0 A/D Converter
15.2.2 Programmable Gain Amplifier Offset Calibration
The programmable gain amplifier has an offset that could be
as high as
want to nullify this offset to obtain more accurate measure-
ments with the A/D converter. Since this amplifier has both
an N channel and P channel pair on its input stage, it’s
CALN
ATRMN6:0 Trim bits used for actual trimming. It uses a
CALP
ATRMNP6:0 Trim bits used for actual trimming. It uses a
15.2.3 Trimming the Offset on the Programmable Gain
Amplifier
Setting the TRIM bit puts the programmable gain amplifier
into a special configuration used for trimming the offset,
which is shown in Figure 28. This configuration enables the
amplifier and puts it into open loop gain. By selecting the
reference voltages, VREFN and VREFP, one at a time, the
offset can be calibrated using the A/D converter. The calibra-
tion routine uses software to perform a successive approxi-
mation algorithm and is indicated below. After the trim algo-
rithm is complete, the trim values are stored in the
AMPTRMN and AMPTRMP registers and should remain,
unchanged, until the algorithm is executed again. The trim
values stored in AMPTRMN and AMPTRMP values are lost
if any type of reset is generated. Therefore, it’s necessary to
retrim after any type of Reset. A method to minimize retrim-
ming would be to store the initial trim values into the virtual
EEPROM memory in addition to AMPTRMN and AMPTRMP.
Then, whenever necessary, the trim values could be re-
trieved from virtual EEPROM, avoiding execution of the trim
algorithm upon a Reset.
The amplifier offset can drift slightly as the temperature
changes. For example, over the entire temperature range of
−40˚C to +125˚C, the drift could be typically 2 mV. If the user
application is in a constantly changing temperature, and this
offset drift is a problem, it is recommended that the amplifier
be retrimmed periodically, or before critical measurements.
CALN
CALP
Bit 7
Bit 7
±
Enables the internal reference, VREFN, for
trimming the N channel pair. Enabled = 1, Dis-
abled = 0. This bit, when = 1, also disables the
analog multiplexor. To perform the trimming al-
gorithm, the TRIM bit must also = 1.
7 mV. When using this amplifier, a user may
Enables the internal reference, VREFP, for
trimming the P channel pair. Enabled = 1,
Disabled =0. This bit, when = 1, also disables
the analog multiplexor. To perform the trim-
ming algorithm, the TRIM bit must also = 1.
signed magnitude method. ATRMP6 is the
sign bit. When ATRMP6 = 1, it compensates
for positive offset. When ATRMP6 = 0, it com-
pensates for negative offset. ATRMP5:0 are
the magnitude of the trim with 000000 = no
trim value and 111111 = highest trim value.
ATRMP6
ATRMN6
Bit 6
Bit 6
ATRMP5
(Continued)
ATRMN5
Bit 5
Bit 5
ATRMN4
ATRMP4
TABLE 31. AMPTRMN
TABLE 32. AMPTRMP
Bit 4
Bit 4
53
necessary to adjust both pairs. This is done with the use of
two volatile registers, AMPTRMN and AMPTRMP, and some
on-chip circuits. The two trim registers will allow for trimming
out the offset in 0.5 mV steps in either direction. Once the
amplifier is trimmed, the trim values are stored in AMPTRMN
and AMPTRMP. Retrimming is necessary after any type of
Reset. These two registers are initialized to 040 (hex) on a
Reset.
The on-chip temperature sensor could also be used to mea-
sure temperature variations and determine whether retrim-
ming of the offset is necessary.
The procedure to trim both the N channel pair and P channel
pair are listed below. Steps 1–14 trim the N channel pair and
steps 15–30 trim the P channel pair.
Note: AN-1199 contains sample assembly code which implements the
1. Set the TRIM bit = 1 in the ADGAIN register to configure
2. Load C0h into the AMPTRMN register to select VREFN
3. Wait 1.05 ms for the amplifier to settle.
4. Load 01h into ENAD to perform an A/D Conversion.
5. Store the result registers.
6. If the three most significant bits of the result are all ones,
7. Set ATRMN6 = 0
8. First time through loop, set ATRMN5 = 1
ATRMN3
ATRMP3
FIGURE 28. Offset Trim Configuration when TRIM = 1
Bit 3
Bit 3
the amplifier.
and the no-trim value.
go to step 8.
Else, if the three most significant bits are all zeros, go to
step 7.
Else, goto step 15.
Second time through loop, set ATRMN4 = 1
Third time through loop, set ATRMN3 = 1
Fourth time through loop, set ATRMN2 = 1
Fifth time through loop, set ATRMN1 = 1
Sixth time through loop, set ATRMN0 = 1
Seventh time through loop, go to step 15.
trim algorithm outline on step 1-30.
signed magnitude method. ATRMN6 is the sign
bit. When ATRMN6 = 1, it compensates for
positive offset. When ATRMN6 = 0, it compen-
sates for negative offset. ATRMN5:0 are the
magnitude of the trim with 000000 = no trim
value and 111111 = highest trim value.
ATRMN2
ATRMP2
Bit 2
Bit 2
ATRMN1
ATRMP1
Bit 1
Bit 1
www.national.com
ATRMN0
ATRMP0
Bit 0
Bit 0
20006358

Related parts for cop8ame9