PC and DACs generate two simple analog outputs
Jim Terrade, Clermont-Ferrand, France -- EDN, 10/14/1999
The simple and inexpensive circuit in Figure 1 generates two PC-controlled analog reference voltages. You supply a wall-adapter supply and a parallel connector, and the circuit is ready to run. The circuit uses two 12-bit AD7243 DACs, which require only one supply voltage. These converters also include internal references, minimizing the number of external components.Simple software uses the parallel port to communicate
with the converters. The two converters connect in series with a connection of
their
and
inputs. This arrangement makes it possible for only three wires to drive the circuit.
The value of N can range from 0 to 4095 because the converters are 12 bits. The converters' internal reference voltages are fixed at 5V. To calculate the number N to enter, you can use the equation N=VX(4095/5), where V is the output voltage. For example, if VB needs to be 4V and VA needs to be 30 mV,Nb=4.000X(4095/5)= 3276 ($CCC), andNa=0.030X(4095/5)=49 ($31).
Figure 2 shows how the transmission occurs. DQ is the 2's complement of the real numbers, Nb and Na, that the PC sends to the converters. The PC sends inverted data because of the presence of the inverting 74HC14 trigger, IC1. RST goes low first to enable the converters. CLK must also go low because the data input is active only on the positive edge of the clock signal; the converter reads data bits only when CLK goes from a low to high level. The transmission starts when the PC sends a 16-bit word—four zeros and then the 12-bit word—for the second converter, IC3, MSB first. Next, the PC sends the 16-bit word for the first converter, IC2, MSB first. Niwm RST and CLK can go high, and the transmission stops.
If more than two converters are necessary, you connect
the
and
signals
to the other converters and connect the
input to the SD_OUT output of IC3. Make sure that the first word the PC sends is the one for the new converter.
Because the 74HC14 is an inverter, you have to consider the following relations—and follow all data-sheet instructions for the AD7243—before reading the C program that drives the converters:
- RST=
=
=Sync - CLK=

- DQ=

Listing 1 shows the structure of the standard C program. (DI #2407)



