D A C. Digital Values. Figure 1: Example Digital-to-Analogue Converter. Vref. Low Pass Filter (LPF) Re-constructed Analogue Signal.

Similar documents
Interfacing Analog to Digital Data Converters

DIGITAL-TO-ANALOGUE AND ANALOGUE-TO-DIGITAL CONVERSION

DAC Digital To Analog Converter

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Electronic Circuits Spring 2007

Hideo Okawara s Mixed Signal Lecture Series. DSP-Based Testing Fundamentals 46 Per-pin Signal Generator

Analog Representations of Sound

AN3252 Application note

Pulse Width Modulation

Digital to Analog and Analog to Digital Conversion

CHAPTER 6 Frequency Response, Bode Plots, and Resonance

Analog signals are those which are naturally occurring. Any analog signal can be converted to a digital signal.

Application Report. 1 Introduction. 2 Resolution of an A-D Converter. 2.1 Signal-to-Noise Ratio (SNR) Harman Grewal... ABSTRACT

Pulse Width Modulation Applications

Accurate Measurement of the Mains Electricity Frequency

Wireless Security Camera

Chapter 6: From Digital-to-Analog and Back Again

Digital Guitar Effects Pedal

Analog to Digital Conversion of Sound with the MSP430F2013

LOW COST MOTOR PROTECTION FILTERS FOR PWM DRIVE APPLICATIONS STOPS MOTOR DAMAGE

Decimal Number (base 10) Binary Number (base 2)

Analog Sound From A Digital Delay

Basics of Digital Recording

GPIB Instrument Control

Asynchronous counters, except for the first block, work independently from a system clock.

Lesson 16 Analog-to-Digital Converter (ADC)

isppac-powr1220at8 I 2 C Hardware Verification Utility User s Guide

User s Guide DDS-3X25 USB ARBITRARY FUNCTION GENERATOR

Digital Sampling Oscilloscope

W a d i a D i g i t a l

Modified Cascaded Five Level Multilevel Inverter Using Hybrid Pulse Width Modulation

AD9741/3/5/6/7 Evaluation Board Quick Start Guide

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1

AC Measurements Using the Oscilloscope and Multimeter by Mr. David Fritz

Digital To Analog Converter with Sine Wave Output

LABORATORY 10 TIME AVERAGES, RMS VALUES AND THE BRIDGE RECTIFIER. Bridge Rectifier

Embedded Systems Design Course Applying the mbed microcontroller

Lab 5 Getting started with analog-digital conversion

Lecture N -1- PHYS Microcontrollers

Analog/Digital Conversion. Analog Signals. Digital Signals. Analog vs. Digital. Interfacing a microprocessor-based system to the real world.

Current and Temperature Ratings

HITACHI INVERTER SJ/L100/300 SERIES PID CONTROL USERS GUIDE

Jitter in (Digital) Audio

Analog-to-Digital Converters. Transducers

Using Arduino Microcontrollers to Sense DC Motor Speed and Position

Improving A D Converter Performance Using Dither

DIODE CIRCUITS LABORATORY. Fig. 8.1a Fig 8.1b

Event counters in NOVA

Diode Applications. As we have already seen the diode can act as a switch Forward biased or reverse biased - On or Off.

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

[F/T] [5] [KHz] [AMP] [3] [V] 4 ) To set DC offset to -2.5V press the following keys [OFS] [+/-] [2] [.] [5] [V]

Eric Mitchell April 2, 2012 Application Note: Control of a 180 Servo Motor with Arduino UNO Development Board

Parallel Port Interfacing with Switches, Keypad and Rotatory encoder

Lecture 18: Common Emitter Amplifier. Maximum Efficiency of Class A Amplifiers. Transformer Coupled Loads.

Analog and Digital Fluorescent Lighting Dimming Systems

SWITCH-MODE POWER SUPPLY CONTROLLER PULSE OUTPUT DC OUTPUT GROUND EXTERNAL FUNCTION SIMULATION ZERO CROSSING INPUT CONTROL EXTERNAL FUNCTION

EXPERIMENT NUMBER 5 BASIC OSCILLOSCOPE OPERATIONS

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Improvements of Reliability of Micro Hydro Power Plants in Sri Lanka

b 1 is the most significant bit (MSB) The MSB is the bit that has the most (largest) influence on the analog output

High-Speed, Low r ON, SPST Analog Switch (1-Bit Bus Switch)

Digital Electronics Detailed Outline

6.025J Medical Device Design Lecture 3: Analog-to-Digital Conversion Prof. Joel L. Dawson

Capacitor Ripple Current Improvements

EVAL-UFDC-1/UFDC-1M-16

L4970A 10A SWITCHING REGULATOR

Section 3. Sensor to ADC Design Example

Microprocessor & Assembly Language

A Digital Timer Implementation using 7 Segment Displays

RISH CON - Hz. Salient Features : Application : Product Features: FREQUENCY TRANSDUCER

Timer A (0 and 1) and PWM EE3376

25. AM radio receiver

PHY-2464 Physical Basis of Music

Microcomputers. Analog-to-Digital and Digital-to-Analog Conversion

AC : PRACTICAL DESIGN PROJECTS UTILIZING COMPLEX PROGRAMMABLE LOGIC DEVICES (CPLD)

Rectifier circuits & DC power supplies

Understanding Delta Conversion Online "Power Regulation" - Part 2

Software Development to Control the Scorbot ER VII Robot With a PC

TS555. Low-power single CMOS timer. Description. Features. The TS555 is a single CMOS timer with very low consumption:

Operating Manual Ver.1.1

Chapter 2 MENJANA MINDA KREATIF DAN INOVATIF

Micro-Step Driving for Stepper Motors: A Case Study

Example: Determine the power supplied by each of the sources, independent and dependent, in this circuit:

PicoScope 5000 Series (A API)

Modeling a GPS Receiver Using SystemC

Contents COUNTER. Unit III- Counters

SYSTEM 45. C R H Electronics Design

Microcontroller based speed control of three phase induction motor using v/f method

AP KHz, 2A PWM BUCK DC/DC CONVERTER. Description. Pin Assignments V IN. Applications. Features. (Top View) GND GND. Output AP1509 GND GND

UDG1000 Hach PCX2200 Serial Port Input Driver configuration

An Introduction to MPLAB Integrated Development Environment

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

ECD 2 High Performance Balanced DAC. 24 Bit /192kHz. Owner's Manual

Analog-to-Digital Voice Encoding

LogicLab s.r.l Via della valle Carate Brianza (MI) Tel Fax

Title : Analog Circuit for Sound Localization Applications

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

INTEGRATED CIRCUITS. For a complete data sheet, please also download:

BIODEX ADDENDUM BIODEX EMG/ANALOG SIGNAL ACCESS CONFIGURATION UTILITY SOFTWARE FOR SYSTEM 3 REVISION 2 AND SYSTEM 4 DYNAMOMETERS

Transcription:

1. Digital To Analogue Converter (DAC) A digital-to-analogue converter (DAC) is a chip or circuit that converts a number (digital) into a voltage or current (analogue). The DAC is a useful interface between a computer and an output transducer. For example, DACs are used to control devices that require a continuous range of control voltages or currents such as electro-acoustic transducers (speakers), some types of variable -speed motors, and many other applications where an analogue signal output is required. Another common application is to re-create waveforms from digital signals for example in CD players. ref D2 D3 D4 D5 D6 D7 D A C o Low Pass Filter (LPF) Re-constructed Analogue Signal 000000 000001 000010 000011 000100 000101 Digital alues Staircase Figure 1: Example Digital-to-Analogue Converter COMP1208-Notes05-DAC.doc RevPA1 Page 1-1 28/03/2007

1.1 Example: 4-bit DAC An N-bit DAC can output 2 N different levels in 2 N -1 steps so if we have an 4 bit DAC then this gives us 2 N = 2 4 = 16 different output levels in 15 steps. ref D2 D3 D A C o D3 D2 o = ref + + + or D D o = ref = ref n 2 4 8 16 2 16 The Output voltage ranges from 0 to ref(15/16) where D= decimal value of the digital input. Table below shows the output voltage for a reference voltage of 10 and various digital inputs. A3 A2 A1 A0 Decimal o 0 0 0 0 0 0.000 0 0 0 1 1 0.625 0 0 1 0 2 1.250 0 0 1 1 3 1.875 0 1 0 0 4 2.500 0 1 0 1 5 3.125 0 1 1 0 6 3.750 0 1 1 1 7 4.375 1 0 0 0 8 5.000 1 0 0 1 9 5.625 1 0 1 0 10 6.250 1 0 1 1 11 6.875 1 1 0 0 252 7.500 1 1 0 1 253 8.125 1 1 1 0 254 8.750 1 1 1 1 255 9.375 Note: The maximum output voltage of the DAC < ref. As the number of bits increases the maximum output voltage -> ref. Example1 What is o of a 4-bit DAC if the input is 0x7 and ref = 10? Answer 1: 0x7 = 0111 = 7 decimal. So o=10(7/2 4 ) = 70/16 = 4.374 Exercise1 What is the maximum output voltage o of a 4-bit DAC if ref = 5? COMP1208-Notes05-DAC.doc RevPA1 Page 2-2 28/03/2007

1.2 Example: 8-bit DAC An N-bit DAC can output 2 N different levels in 2 N -1 steps so if we have an 8 bit DAC then this gives us 2 N = 2 8 = 256 different o/p levels in 2 8-1 = 255 steps. ref D2 D3 D4 D5 D6 D7 D A C o A7 A6 A5 A4 A2 A2 A1 A0 o = ref + + + + + + + o r D D o = ref = ref n 2 4 8 16 32 64 128 256 2 256 where D= decimal value of the digital input. Table below shows the output voltage for a reference voltage of 10 and various digital inputs. A7 A6 A5 A4 A3 A2 A1 A0 Decimal o 0 0 0 0 0 0 0 0 0 0.000000 0 0 0 0 0 0 0 1 1 0.039063 0 0 0 0 0 0 1 0 2 0.078125 0 0 0 0 0 0 1 1 3 0.117188 0 0 0 0 0 1 0 0 4 0.156250 0 0 0 0 0 1 0 1 5 0.195313 0 0 0 0 0 1 1 0 6 0.234375 0 0 0 0 0 1 1 1 7 0.273438 1 1 1 1 1 1 0 0 252 9.843750 1 1 1 1 1 1 0 1 253 9.882813 1 1 1 1 1 1 1 0 254 9.921875 1 1 1 1 1 1 1 1 255 9.960938 Example 2 What is o if the input is 0x30 and ref = 10? Answer 1: 0x30 = 00110000b = 48 decimal So o=10(48/256) = 1.875 Exercise 2 What is o if the input is 0x73 and ref = 10? COMP1208-Notes05-DAC.doc RevPA1 Page 3-3 28/03/2007

2. Function Generation Using DAC In this section we look at developing a simple C/C++ program to generate waveforms using an 8-bit DAC. 2.1 The Ramp Generator: The program Ramp.c shown below generates a sawtooth waveform by inputting incrementing numbers from 0 to 255 to an 8-bit DAC connected to a PC via the parallel interface. Example: ramp.cpp #include <conio.h> void delay(int time); #define DATA_PORT 0x378 #define CONTROL_PORT 0x37A // Address of Data Register // Address of Control Register int main() _outp(control_port,0x01); for(int count=0;count<=255;count++) _outp(data_port,count); delay(100); //configure the port to write out //output the data to the port //add a delay to vary frequency return 0; if(count==255) count=0; // Rough delay function void delay(int time) for (int i=0;i<time;i++) for (int j=time;j>0;j--); iewing the output of the DAC (assume ref=10) produces the following sawtooth waveform. 11 Sawtooth Waveform from 8-bit DAC 10 ref=10 9 8 7 255 Steps 6 5 oltage 4 () 3 2 1 0 0 0.005 0.01 0.015 0.02 0.025 Time (s) Figure 2: Sawtooth Waveform A low pass filter can be used to smooth out the digital stairsteps COMP1208-Notes05-DAC.doc RevPA1 Page 4-4 28/03/2007

Flowchart for Ramp.cpp program START OUTPUT 0x01 to CONTROL_PORT count=0 count 255? false OUTPUT count to DATA_PORT delay(t) true count =255? false true count=0 Increment count STOP 2.2 In class Exercise: Triangular Waveform Using the Ramp.cpp program as a template, write a C++ program that generates a triangular waveform. #include <conio.h> void delay(int time); #define DATA_PORT 0x378 #define CONTROL_PORT 0x37A // Address of Data Register // Address of Control Register int main() _outp(control_port,0x01); while( true ) for(int count=0;count<=255;count++) _outp(data_port,count); delay(100); for(count=254;count>=0;count--) _outp(data_port,count); delay(100); return 0; // Rough delay function void delay(int time) for (int i=0;i<time;i++) for (int j=time;j>0;j--); //configure the port to write out //output the data to the port //add a delay to vary frequency //output the data to the port //add a delay to vary frequency Draw a flowchart that describes a program that generates a triangular waveform. COMP1208-Notes05-DAC.doc RevPA1 Page 5-5 28/03/2007

2.3 In Class Exercise: Sinusoidal Waveform Using the Ramp.cpp program as a template, write a C++ program that generates a sinusoidal waveform. Draw a flowchart that describes a program which generates a sinusoidal waveform. COMP1208-Notes05-DAC.doc RevPA1 Page 6-6 28/03/2007