80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
DAC Interfacing with 8051.pdf
1. Interfacing DAC with 8051 T.Srikrishna , M.Sc, M.Tech, GVP
DAC Interfacing with 8051
The DAC is a device widely used to convert digital pulses to
analog signals.
Here we will discuss the basics of interfacing a DAC to 8051.
In these systems MC generates output which is in digital form.
But the controlling system requires analog signal as they don't
accept digital data.
Thus it necessary to use DAC which converts digital data into
equivalent analog voltage.
In the figure shown, we use 8-bit DAC 0808.
This IC converts digital data into equivalent analog Current.
Hence we require an I to V converter to convert this current
into equivalent voltage.
The two methods of creating a DAC is Binary weighted and
R/2R ladder network.
We will also see the triangular and square wave generation.
2. Interfacing DAC with 8051 T.Srikrishna , M.Sc, M.Tech, GVP
In the DAC0808, the digital inputs are converted to current (Iout),
and by connecting a resistor and op-amp to the Iout pin, we convert
the result to voltage Vo.
According to theory of DAC Equivalent analog output is given as:
3. Interfacing DAC with 8051 T.Srikrishna , M.Sc, M.Tech, GVP
Exmple:
1. IF data =00H [00000000], Vref= 10V
Therefore, V0= 0 Volts.
2. If data is 80H [10000000], Vref= 10V
Therefore, V0= 5 Volts.
Different Analog output voltages for different Digital signal is given
as:
4. Interfacing DAC with 8051 T.Srikrishna , M.Sc, M.Tech, GVP
8051 Assembly code to generate triangular wave
ORG 0000H
CLR A
UP: INC A
MOV P2,A
CJNE A, #0FFH, UP
DOWN: DEC A
MOV P2,A
CJNE A, #00, DOWN
SJMP UP
END
8051 Assembly code to generate SUARE wave
ORG 0000H
BACK MOV A, #00H
UP; MOV P1,A
CALL DELAY
DOWN: MOV A,FFH
MOV P1,A
CALL DELAY
SJMP BACK.
DELAY: MOV R2,#0FFH
WAIT: DJNZ R2, WAIT
RET