8XC196MC, MD, MH USER’S MANUAL

AD_RESULT (Write)

Address:

1FAAH

 

Reset State (MC, MD):

FFC0H

 

Reset State (MH):

7FC0H

The high byte of the A/D result (AD_RESULT) register can be written to set the reference voltage for the A/D threshold-detection modes.

15

REFV7

REFV6

REFV5

REFV4

7

 

 

 

 

 

 

 

 

 

 

 

8

REFV3

REFV2

REFV1

REFV0

 

 

 

0

 

 

 

 

 

 

 

 

Bit

Bit

Function

Number

Mnemonic

 

 

 

 

15:8

REFV7:0

Reference Voltage

 

 

These bits specify the threshold value. This selects a reference voltage

 

 

that is compared with an analog input pin. When the voltage on the

 

 

analog input pin crosses over (detect high) or under (detect low) the

 

 

threshold value, the A/D conversion complete interrupt pending bit is set.

 

 

Use the following formula to determine the value to write to this register

 

 

for a given threshold voltage.

 

 

reference voltage = desired----------------------threshold--------------------------voltage---------------------×-----256--------

 

 

VREF ANGND

7:0

Reserved; for compatibility with future devices, write zeros to these bits.

 

 

 

Figure 12-3. A/D Result (AD_RESULT) Register — Write Format

12.4.3 Programming the A/D Time Register

Two parameters, sample time and conversion time, control the time required for an A/D conver- sion. The sample time is the length of time that the analog input voltage is actually connected to the sample capacitor. If this time is too short, the sample capacitor will not charge completely. If the sample time is too long, the input voltage may change and cause conversion errors. The con- version time is the length of time required to convert the analog input voltage stored on the sample capacitor to a digital value. The conversion time must be long enough for the comparator and cir- cuitry to settle and resolve the voltage. Excessively long conversion times allow the sample ca- pacitor to discharge, degrading accuracy.

The AD_TIME register (Figure 12-4) specifies the A/D sample and conversion times. To avoid erroneous conversion results, use the TSAM and TCONV specifications on the datasheet to determine appropriate values.

12-6

Page 271
Image 271
Intel 8XC196MH, 8XC196MD, 8XC196MC manual Programming the A/D Time Register, Adresult Write