3.4.2. Generates Step Voltage from DAC - Parallel
Port
In this lesson we are like to design, how to generate
a voltage from DAC0808. There is something you must to do is to calculate
the konstanta K, as you have learned in previous lesson, in this experiment
we would like to generate step voltage from an input on Edit1 component.
Build the circuit as shown in figure bellow. Port Data D0 trough D7
is connected to A8 - A1, for example, we assumes that the Vref = 5 volt,
R14 = 5 k, and Rf = 5k.
K = Vref/ R14;
= 5/5k = 1 mA If, we put logic high into A1 through A8 then we have: Io = 1 mA x 0.99 = 1 mA So,Vo = Io x Rf = 1 mA x 5k = 5 volt Voltage Resolution = 5/255 = 0.02 volt
If you like to send a 2 volt out from your DAC, than you must write down this decimal = 2/0.02 = 100 decimal
a. Puts 1 Edit Components, 1 Button and label on Form,
as shown in picture bellow.
b.Click on button1 component to insert with the
program as shown bellow
procedure TDAC.Button1Click(Sender: TObject); var data,DAC:byte; begin data:=strtoint(edit1.text); DAC:=(Data*255) DIV 5; asm mov dx,$378 mov al,DAC out dx,al end; end;
c. To run the program, you can hits F9 or RUN menu,
and then you will show a picture as shown bellow, and try to simulate
the program by a number betwen 1 trough 5 on edit1 and hit START button.