1 Lab 4: D/A Converter. 2 1000 Lab 4: D/A Converter This is a simple resistive network for a D/A converter Port 1, Port 0 are digital inputs ==> 00 (minimum),

Slides:



Advertisements
Similar presentations
Mark Neil - Microprocessor Course 1 Device Drivers – Digital Voltmeter.
Advertisements

Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
Analog-to-Digital Converter (ADC) And
SHIFT REGISTERS: CONVERTING BETWEEN SERIAL AND PARALLEL DATA Mark Neil - Microprocessor Course 1 Serial versus Parallel Data Transfers.
Digital to Analogue Conversion Chapter 13. Why is conversion needed? Most signals in the world are analogue. Microprocessors and most computers computers.
Robotics Club, Snt Council2 The 3 Schools of Robotics: Mechanical Design – Types of motors – Material selection –
MICRO-CONTROLLER: A microcontroller is the brain of the robot: These are: 1. Integrated Circuits (ICs) 2. Programmable.
Analog to Digital Conversion
ECE 265 – LECTURE 14 Analog Signal Acquisition The A/D converters 5/14/ ECE265.
-Done By Haresh Miriyala
1 Lab2: A/D Converter. 2 This circuit connects a variable voltage to an A/D port on the AVR mcu. Your software running on the AVR mcu will read the digital.
Better Debugging of Embedded via a Debug Port ECE152.
Counter Circuits and VHDL State Machines
Better Debugging of Embedded via a Debug Port ECE152.
Railway Foundation Electronic, Electrical and Processor Engineering.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Railway Foundation Electronic, Electrical and Processor Engineering.
ASPPRATECH.
Robotics Research Laboratory Louisiana State University.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
Serial Communication ETEC 6416.
Digital-to-Analog & Analog-to- Digital Conversion Anuroop Gaddam.
Input/Output mechanisms
Clock Options and Sleep Modes. Clock Sources Flash Fuse bits can be programmed to choose one of the following Clock sources: 1. External RC Osc. f = 1/(3RC).
MCU: Interrupts and Timers Ganesh Pitchiah. What’s an MCU ?
Digital-to-Analog Analog-to-Digital Microprocessor Interface.
ELE2MIC Lecture 21 The AVR Sleep Modes ATMEGA128’s Analog to Digital Converter –Features –Block Diagram –Clock Source –Input Sources –Interrupts –BandGap.
RS232 #use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7
1 Lab 1: Introduction. 2 Configure ATMEL AVR Starter Kit 500 (STK500), a prototyping/development board for Lab1. ATmega16 ( V) is the chip used.
1 Lab 5: Controls and feedback. 2 Lab 5: Control and Feedback This embedded system uses the Photo sensor to detect the light intensity of the environment.
Atmel Atmega128 Overview ALU Particulars RISC Architecture 133, Mostly single cycle instructions 2 Address instructions (opcode, Rs, Rd, offset) 32x8 Register.
ATMEL AVR 8 bit RISC MICROCONTROLLERS a general comparison.
1 Lecture on Lab 6 Lab 7 Lab 8. 2 Lab 6: Open Loop Controller As you learned in lab 5, there are two kinds of control systems: open loop and closed loop.
ATtiny23131 A SEMINAR ON AVR MICROCONTROLLER ATtiny2313.
Timers and Interrupts Anurag Dwivedi. Let Us Revise.
Suleyman Demirel University CSS340 Microprocessor Systems – Lecture 2 ATMEGA328P ARCHITECTURE ANALOG INPUTS.
CHAPTER 19 Data Conversion. Objectives Describe and Analyze: Analog vs. Digital Signals Resolution Digital-to-Analog Conversion Analog-to Digital Conversion.
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Module #7 Assessment Quiz.
Analog Capture- Port E. Digital to Analog and Analog to Digital Conversion D/A or DAC and A/D or ADC.
ARDUINO 1. Basics  Comments  /* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the serial communication.
Analog to Digital Converter (ADC). Analog to Digital Converters  Microcontroller understands only digital language.  To convert the analog output from.
Detection Circuit ENGR Pre Lab.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an introduction to the peripheral functions.
Analog to Digital Converter (ADC)
Analog to Digital Conversion - ADC Mark Neil - Microprocessor Course 1 Device Drivers – Measuring Voltages.
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
SHIFT REGISTERS: CONVERTING BETWEEN SERIAL AND PARALLEL DATA Mark Neil - Microprocessor Course 1 Serial versus Parallel Data Transfers.
Digital-to-Analog Analog-to-Digital Week 10. Data Handling Systems  Both data about the physical world and control signals sent to interact with the.
Microcontroller basics Embedded systems for mortals.
ECE 101 Exploring Electrical Engineering Chapter 7 Data Acquisition Herbert G. Mayer, PSU Status 11/30/2015 Derived with permission from PSU Prof. Phillip.
Electronic instrumentation Digitization of Analog Signal in TD
EKT 314/4 WEEK 9 : CHAPTER 4 DATA ACQUISITION AND CONVERSION ELECTRONIC INSTRUMENTATION.
Digital-to-Analog Analog-to-Digital
Task 2: Define digital and analogue signals
1. PIC ADC  PIC18F877 has 8 analog input channels i.e. port A pins(RA0 to RA5) and port E pins(RE1 and RE2). These pins are used as Analog input pins.
INTERFACING HARDWARE WITH MICROCONTROLLER GUIDED BY: Prof. ASIF SIR 1. AKSHAY KIRAN 2. DEEP PARIKH 3. JIGAR PATEL 4. TILAK PATEL ,05,D2D06,09.
Residential Audio & Video Systems Copyright © 2005 Heathkit Company, Inc. All Rights Reserved Presentation 15 – Digital Audio and Video.
Digital-to-Analog Analog-to-Digital
Digital-to-Analog Analog-to-Digital
Analog Comparator An analog comparator is available on pins PE2(AIN0), PE3(AIN1) The comparator operates like any other comparator. -when (+) exceeds (-)
Digital-to-Analog Analog-to-Digital
Chapter 13 Linear-Digital ICs
ADC,DAC and sensor interface
Principles & Applications
Digital-to-Analog Analog-to-Digital
Analogue to Digital Conversion
CSCI1600: Embedded and Real Time Software
ADC and DAC Programming in AVR
Presentation transcript:

1 Lab 4: D/A Converter

Lab 4: D/A Converter This is a simple resistive network for a D/A converter Port 1, Port 0 are digital inputs ==> 00 (minimum), 01, 10, 11 (maximum) You need to design the resistive network to generate proper outputs. For ECE5430 students, a four-bit D/A is recommended ohms

3 Lab4: D/A Converter STK500 reads the analog value from VA using ADC channel 0

4 Lab 4: D/A Converter Equations for D/A Outputs: B’00:0.0 VS = (R1 || R2 || R3 ) * (0 Volts) B’01:0.3 VS = (R1 || R3 ) * (5 volts) / ((R1 || R3 ) + R2 ) B’10: 0.7 VS = (R1 || R2 ) * (5 volts) / ((R1 || R2 ) + R3 ) B’11:1.0 VS = R1 * (5 volts) / ((R2 || R3 ) + R1 ) Given: VS = 4 Volts, R1 = 1000 Find R2 and R3 by solving 2 equations with 2 variables using the equations for B’01 and B’11. Here we choose R1 = 1000 ohms. You can choose any proper value you want for R1. If R1 is too small, it may require large currents resulting in overheat problem.

5 Lab 4: D/A Converter

6

7 In-Lab Tasks Construct Circuit 4-1 with appropriate values of resistance. Do NOT connect Circuit 4-1 to the AVR mcu. Given your computed values of R2 and R3, verify the voltage of VA for the four possible port values. Connect Circuit to the AVR mcu. Write software for the AVR mcu that sets analog voltages at VA. Have the software loop through the voltages from 0.0VS, 0.30VS, xVS, 1.0VS and step back down to 0.0VS. Include a delay between each value. Use the C-routine delay_ms() in to generate the delay. Verify and document the resulting voltages of VA.

8 Lab 4: D/A Converter Initialize peripherals in ATMEGA16  P: Port x : Output to LED’s  Port x : DAC output on pins 0 & 1  Port D : UART on pins 0 & 1  UART : 9600 baud, 8-N-1 Display opening marquee Start counter at 0 Start Port x = counter (to DAC) Port x = ~ counter (to LED’s) Increment counter so it runs: 1, 2, 3, 4, 1, 2 … Delay 2.5 seconds for voltage measurement Sample of Software flowchart

9 Lab 4: D/A Converter Initialization code for the ADC: // ADC initialization // ADC Clock frequency: kHz // ADC Voltage Reference: AREF pin // ADC High Speed Mode: Off // ADC Auto Trigger Source: None

10 Lab 4: D/A Converter Code for reading an ADC channel: // Read the AD conversion result unsigned int read_adc(unsigned char adc_input) { ADMUX = adc_input|ADC_VREF_TYPE; // Start the AD conversion ADCSRA |= 0x40; // Wait for the AD conversion to complete while ((ADCSRA & 0x10)==0); ADCSRA|=0x10; return ADCW; }

11 Lab 4: D/C Converter Suppose PB1 and PB0 are used as bit 1 and bit 0. They need to be set up as outputs and initially cleared. Initialization code for PORT B: // Port B initialization // Use b1 and b0 as the output pins to drive the resistor network. PORTB=0x00; // Clear output. DDRB=0x03; // Set up bit1-0 as outputs.

12 Lab 4: D/A Converter UART Design Set up the UART port to display the voltage at each step of the digital output. Initialization code for the UART: // Use UART for initial debug and later to output the count after // the count has been stopped. // USART initialization // Communication Parameters: 8 Data, 1 Stop, No Parity // USART Receiver: On // USART Transmitter: On // USART Mode: Asynchronous // USART Baud rate: 9600 UCSRA=0x00; UCSRB=0x18; UCSRC=0x86; UBRRL=0x17; UBRRH=0x00;

13 Lab 4: D/A Converter while (1) { // Loop from b00, b01, b10, b11. for( i = 0; i < 4; i++ ) { // Change to the next D to A step. PORTB = i; // Delay for 2 seconds delay_ms( 2000 ); // Print the voltage to the screen. value = read_adc( 0x0 ); voltage = value * 5 / 1023; ??????

14 Lab 4: D/A Converter Terminal need to display: –Binary Output (first column) –ADC Reading (second column) –Voltmeter Reading (third column) Volts Volts Volts Volts Volts Volts Volts Volts