Coursify

Microprocessor

ADC and DAC Interfacing

1 hour

Learning Goals

  • Understand ADC principles: recognizing analog-to-digital conversion process transforming analog input signals to digital words, understanding resolution (8-bit, 10-bit, 12-bit) determining quantization levels, and analyzing sampling rate requirements for signal fidelity
  • Master ADC interfacing: connecting analog signal input to ADC chip, utilizing Start-of-Conversion (SOC) signal to trigger conversion, monitoring End-of-Conversion (EOC) signal indicating result ready, and reading digital output through I/O ports or memory-mapped registers
  • Apply ADC timing synchronization: managing ADC conversion time (typically 10-100 microseconds depending on resolution), implementing polling or interrupt-driven result acquisition, and ensuring data valid before reading digital output word
  • Understand DAC principles: recognizing digital-to-analog conversion transforming digital words to proportional analog voltages, understanding resolution relationship to output voltage range, and analyzing settling time for output stabilization
  • Master DAC interfacing: applying digital word to DAC input through I/O ports or memory-mapped registers, understanding internal conversion to analog voltage, recognizing output buffer requirements for driving external loads, and managing reference voltage sources
  • Apply signal processing strategies: implementing multiple ADC inputs for multi-channel signal acquisition, managing sample timing for synchronized multi-channel conversion, implementing data filtering for noise reduction, and preprocessing digital data
  • Understand analog front-end design: recognizing protection and conditioning circuits for analog inputs (anti-aliasing filters, buffering amplifiers), understanding output driver requirements for DAC loads (impedance buffering, current sourcing capability)
  • Apply practical instrumentation: implementing process monitoring with ADC feedback, generating control signals with DAC output, recognizing real-time processing constraints in embedded analog applications, and managing signal integrity

In embedded systems, microprocessors operate in a discrete digital domain, while the physical environment is inherently analog. Analog-to-Digital Converters (ADC) and Digital-to-Analog Converters (DAC) serve as the critical bridges between these two worlds .

ADC interfacing allows a microprocessor to "read" sensors (temperature, pressure, light), while DAC interfacing enables it to "act" upon the environment by generating control signals or waveforms (motor speed, audio output). This section explores the principles, timing synchronization, and practical interfacing strategies for both components within a microprocessor architecture.

Key Concepts in Conversion

  • Resolution: Defines the smallest change in analog voltage that can be represented. For an nn-bit converter, there are 2n2^n quantization levels.
  • Quantization Error: The inherent uncertainty (±1/2\pm 1/2 LSB) caused by representing a continuous signal with discrete levels.
  • Sampling Rate: The frequency at which the analog signal is measured, governed by the Nyquist-Shannon Sampling Theorem (fs2fmaxf_s \ge 2f_{max}) .

Footnotes

  1. Interfacing ADC and DAC with 8086 - Comprehensive slides on 8255-based interfacing, SOC/EOC timing, and waveform generation.

  2. ADC/DAC Performance for Digital Control Systems - Detailed technical paper on sampling rates, resolution constraints, and system accuracy.

Interfacing ADC 0808 with 8086 Microprocessor

ADC Principles and Interfacing

Interfacing an ADC like the ADC0808/0809 (8-bit Successive Approximation type) requires precise timing and handshake signals to ensure data integrity .

Control Signals

  1. SOC (Start of Conversion): A pulse sent by the microprocessor to initiate the conversion process.
  2. EOC (End of Conversion): A signal from the ADC indicating that the digital word is ready.
  3. ALE (Address Latch Enable): Used to latch the channel address in multi-channel ADCs.
  4. OE (Output Enable): High signal to read the converted data from the ADC's internal buffers.

Resolution Calculation

The analog voltage equivalent of the Least Significant Bit (LSB) is calculated as: VLSB=Vref(+)Vref()2nV_{LSB} = \frac{V_{ref(+)}-V_{ref(-)}}{2^n} For an 8-bit ADC with a 5.12V reference, each step is exactly 5.12256=20 mV\frac{5.12}{256} = 20\text{ mV}.

Footnotes

  1. ADC and DAC Interfacing Techniques - Practical guide to interfacing ADC0808 and DAC0808 with 8086/8085 microprocessors.

The ADC Acquisition Cycle

  1. 1
    Step 1

    The microprocessor provides a 3-bit address (A, B, C) to the ADC's internal multiplexer to select one of the 8 input channels. ALE is pulsed to lock this address.

  2. 2
    Step 2

    The CPU issues a SOC pulse. The ADC starts its successive approximation logic, which typically takes 10-100 microseconds .

    Footnotes

    1. Interfacing ADC and DAC with 8086 - Comprehensive slides on 8255-based interfacing, SOC/EOC timing, and waveform generation.

  3. 3
    Step 3

    The CPU either polls the EOC pin (Status Check) or waits for an interrupt triggered by the EOC signal to know the data is ready.

  4. 4
    Step 4

    Once EOC is active, the CPU enables OE and reads the 8-bit digital word from the data bus through an I/O port (e.g., 8255 Port A).

Nyquist Frequency & Anti-Aliasing

To prevent 'aliasing' (where high-frequency noise appears as low-frequency signals), always use a low-pass Anti-Aliasing Filter before the ADC input. Ensure your sampling frequency fsf_s is at least twice the highest frequency component of your signal .

Footnotes

  1. ADC/DAC Performance for Digital Control Systems - Detailed technical paper on sampling rates, resolution constraints, and system accuracy.

Quantization Levels by Resolution

Comparison of discrete levels available for different bit-depths

DAC Principles and Waveform Generation

A Digital-to-Analog Converter (DAC), such as the DAC0808, converts a binary word into a proportional current or voltage . Most DACs use an R-2R Ladder network to maintain high precision without requiring a wide range of resistor values.

Output Characteristics

  • Settling Time: The time required for the analog output to reach its final value within a specified error band (e.g., ±1/2\pm 1/2 LSB).
  • Reference Voltage (VrefV_{ref}): Determines the full-scale output range. Stability of VrefV_{ref} is critical for accuracy.
  • Output Buffering: Since many DACs provide a current output, an Operational Amplifier is often used as a current-to-voltage (II-to-VV) converter to drive external loads.

Vout=Vref×(D721+D622++D028)V_{out} = V_{ref} \times \left( \frac{D_7}{2^1} + \frac{D_6}{2^2} + \dots + \frac{D_0}{2^8} \right)

Footnotes

  1. ADC and DAC Interfacing Techniques - Practical guide to interfacing ADC0808 and DAC0808 with 8086/8085 microprocessors.

The CPU repeatedly reads the EOC signal in a loop. Simple to implement but wastes CPU cycles.

1WAIT: IN AL, PORT_C ; Read EOC status 2 TEST AL, 01H ; Check if EOC is high 3 JZ WAIT ; Loop until ready 4 IN AL, PORT_A ; Read digital result

Analog Front-End & Signal Integrity

Ground Loops & Noise

Analog and digital grounds should be separated on the PCB and joined at a single point (Star Ground) to prevent digital switching noise from corrupting sensitive analog measurements.

Knowledge Check

Question 1 of 3
Q1Single choice

Which signal is issued by the microprocessor to start the ADC conversion process?