Q6Microprocessor
Question
Q.6. Explain the interfacing of Analog to Digital and Digital to Analog converter with 8051 microcontroller.
Answer
An ADC (such as ADC0808) is interfaced via a data port and control lines (ALE, START, EOC, OE) to convert an analog input into digital data readable by the 8051, while a DAC (such as DAC0808) is interfaced via a data port that the 8051 writes a digital value to, which the DAC converts into a corresponding analog output current/voltage.
A/D Converter (ADC0808/0809) Interfacing: the ADC0808 is an 8-bit, 8-channel successive-approximation ADC. Its 8-bit digital output (D0-D7) is connected to an 8051 I/O port (e.g., Port 1); its 3-bit channel address input (ADDA, ADDB, ADDC) selects which of the 8 analog input channels is to be converted, typically driven by 3 additional 8051 output pins; and its control signals — ALE (latching the channel address), START (initiating conversion, typically pulsed together with or immediately after ALE), EOC (End Of Conversion, an output from the ADC indicating when the digital result is ready, either polled by software or used to trigger an interrupt), and OE (Output Enable, which the 8051 asserts to enable the ADC's tri-state output buffer, allowing the converted digital data to actually appear on the D0-D7 bus for the 8051 to read) — are connected to further 8051 I/O pins. The typical software sequence is: set the channel address, pulse ALE and START, wait for (poll or interrupt on) EOC to go high, assert OE, and read the resulting digital value from the data port.
D/A Converter (DAC0808) Interfacing: the DAC0808 is an 8-bit multiplying DAC. Its 8-bit digital input (D0-D7) is connected to an 8051 output port (e.g., Port 1); the 8051 simply writes the desired 8-bit digital value to this port, and the DAC0808 converts it into a proportional analog output current, which is typically converted into a corresponding analog output voltage using an external operational amplifier configured as a current-to-voltage converter. Unlike the ADC interfacing sequence, DAC interfacing requires no handshaking control signals (no ALE, START, EOC, or OE equivalent) since the DAC0808 conversion is effectively instantaneous (settling time in the microsecond range) and continuously tracks whatever digital value is currently present at its input — the 8051 program simply computes or looks up the desired output value and writes it directly to the DAC's data port whenever a new analog output value is required, such as periodically within a timer-driven loop to generate a specific analog waveform (e.g., a staircase, triangular, or approximated sinusoidal waveform) by writing a sequence of pre-calculated digital values to the DAC at regular time intervals.