Specifications
165
CONSTRUCTION
Fig. 5: PIC16C84-based R-2R DAC
Fig. 6: Actual-size single-sided PCB layout for
the schematic diagram of Fig. 5
TABLE I
Cost comparison between a dedicated 8-bit
IC DAC and an 8-bit R-2R DAC
Sl. Item *Cost (Rs.) *Cost (Rs.)
No. Dedicated IC R-2R (Fig.2)
DAC DAC
1. Supplies 78.00 NIL
±5V and
+10V (ref.)
2. IC (DAC) 55.00 NIL
3. IC (opamp) 7.00 NIL
4. Cermet (for
reference
adjustment) 16.00 NIL
5. Resistors 2.00 5.00
Total cost 158.00 5.00
*Note: Costs indicated are typical retail prices.
Fig. 7: Component layout for PCB of Fig. 6
TABLE II
Important features of PIC16C84
Architecture: RISC CPU
Clock: 10MHz, 400ns instruction cycle
Instructions: 14-bit wide
Program memory: 1k x 14-bit (EEPROM).
RAM: 36 x 8-bit (SRAM)
Data memory: 64 x 8-bit for user data
Supply voltages: 2.7V to 5.5V with very low current
consumption
I/O ports: 13 I/O lines with individual control hav-
ing 25mA current sinking and 20mA cur-
rent-sourcing capability
Timer: 8-bit timer/counter with 8-bit pre-scaler
Watchdog timer with on-chip RC oscillator, and 8-level deep
hardware lock.
PARTS LIST
Semiconductor:
IC1 - PIC16C84, microcontroller
D1-D5 - 1N4148 switching diode
LED1-LED5 - 0.3-inch dia red LED
Resistors (all ¼-watt, ±5% carbon, unless
stated otherwise):
R1, R15-R23 - 10-kilo-ohm
R2-R6 - 560-ohm
R7-R14 - 20-kilo-ohm
Capacitors:
C1, C2 - 27pF ceramic disk
Miscellaneous:
X
TAL
- 3.575545MHz crystal
S1 - Push-to-on switch
One of the basic DAC circuits, which
uses precision binary weighted resistors
and an op-amp for the conversion pro-
cess, is shown in Fig. 1. The requirement
of precision resistors (from R through
2
n-1
x R values) is the
main drawback of
this design. It is
overcome in the R-
2R ladder network
type DAC. Such a
DAC, as shown in
Fig. 2, uses only two
values of resistors
for any combination
of bits.
In either of the
above two cases, the
maximum output
voltage V
out
, with all
input bits at logic 1,
is given by the expression: V
out
=
[(2
n
-1)/2
n
] x V
in
, and the output volt-
age with only the LSB at logic 1
will be: V
out
= 1/2
n
x V
in
. Here, V
out
is the output voltage, n are the
number of bits, and V
in
is the ref-
erence input voltage (usually, +5
volt in a logic system). For example,
an 8-bit DAC, with a reference volt-
age level of 5V, will have a range
from 19.53 mV (with only the LSB
at logic 1) to 4.98V (with all eight
bits at logic 1). Because of its sim-
plicity, the R-2R ladder network or
its variants are used in most of the inte-
grating type DACs. While using inte-
grated-type DACs, the following knowl-
edge will come handy:
(a) Power supply. Single +5V to +15V
or double ±5V to ±15V
(b) Reference input. Varies from chip
to chip.
(c) An operational amplifier is needed
at the output to convert current into volt-
age.
(d) The cost increases drastically as
the number of bits (resolution) and/or the
speed increases.
(e) Sometimes it is not feasible to use
a dual-supply converter for a single-po-
larity (usually positive) signal or in bat-
tery-powered systems.