Академический Документы
Профессиональный Документы
Культура Документы
r
tiato r
ren to
fe gra or
Dif Inte arat
Analog mp
+ Co
Signal Input +
Digital Filter Multi-Bit
–
Digital Output
–
VREF
VDD PIC16C6XX
R1 R2 YES NO
47kΩ 47kΩ RA3 VREF > VRAO
VIN
CINT
RA3 := 1 RA3 := 0
100nf INCR (result)
PORTA<3>
Firmware
Closes INCR(counter)
RA0 Comparator Loop
–
VDD
C1
RA2
+ C1OUT NO YES
VREF = VDD/2 counter = 1024?
(can be
CMCON := 0000 0011 internal or external)
VRCON := 1110 1100 CMCON := 0x03
◆
result_h. ◆
■ ◆ ◆■ ■ ■ ■ ■ ■
is transmitted at 9600 baud via RB7. The answers can 512 ■ ■ ■ ■■ ■
◆
◆
◆
■■ ■ ■■
0
◆
be displayed on a dumb terminal program such as ■■ ■■ ■
◆
◆
◆
◆ ■ ■ ■ ■ ■
◆
◆
Hyperterm included with Windows ’95. ◆
◆
◆ ■■ ■■
256 ◆
◆
◆ -2
◆
◆
◆
◆
100 ◆
◆
◆
◆
Time per Conversion (sec)
0 1 2 3 4 5
10 VIN (V)
◆ Output ■
1
FIGURE 5: Room temperature test data for the circuit
shown in Figure 2. The input voltage range is 0.003 to
0.1 4.99V. The maximum error found in the test was ±2
counts. In this 10-bit system that is equivalent to
0.01 ±9.8mV. This test was performed using one sample.
Results may vary from part to part. VDD = 5V, calibration
10 11 12 13 14 15 16 17 18 19 20
performed at 0.5V and 4.99V.
Bits Resolution
The A/D error was calculated assuming the codes for
FIGURE 4: Conversion time versus bits of resolution Vin = 0.5V and Vin = 4.5V are ideal. This test was per-
assuming a 20 µs integration time. formed with one microcontoller at room temperature.
These result may vary from part to part.
Each integration result is taken at a regular time interval.
If it is assumed that the time interval of a conversion is
20µs, the conversion time versus bits can easily be calcu-
lated. This relationship is shown graphically in Figure 4.
For instance, a 10-bit conversion would require 210 or
1024 samples. If the microcontroller conversion loop is
20µs, one complete conversion would take 20.48ms.
Room temperature test data for the circuit shown in Fig-
ure 2 is graphed in Figure 5. In Figure 5, the voltage
input is plotted versus the output code on the left axis
and the output error on the right axis. This data was
taken with the 1024 laps through the flow chart in Fig-
ure 3. The expected resolution of this configuration is
10-bits. The maximum code error for this test was ±2
counts or 2-bits of uncertainty. Consequently, the effec-
tive number of bits of this A/D Converter is 8-bits. The
core portion of the code that was used to perform this
conversion is listed at the end of the application note.
REFERENCES
Cox, Doug, “Implementing Ohmmeter/Temperature
Sensor”, AN512, Microchip Technology, Inc.
Richey, Rodger, “Resistance and Capacitance Meter
Using a PIC16C622”, AN611, Microchip Technology,
Inc.
• The PICmicro family meets the specifications contained in the Microchip Data Sheet.
• Microchip believes that its family of PICmicro microcontrollers is one of the most secure products of its kind on the market today,
when used in the intended manner and under normal conditions.
• There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowl-
edge, require using the PICmicro microcontroller in a manner outside the operating specifications contained in the data sheet.
The person doing so may be engaged in theft of intellectual property.
• Microchip is willing to work with the customer who is concerned about the integrity of their code.
• Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable”.
• Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of
our product.
If you have any further questions about this matter, please contact the local sales office nearest to you.
01/18/02