Module 13: Interfacing ADC. Introduction ADC Programming DAC Programming Sensor Interfacing

Similar documents
Microcontroller Systems. ELET 3232 Topic 21: ADC Basics

EE 308: Microcontrollers

Analogue to Digital Conversion on an ATmega168

Embedded Systems and Software. Analog to Digital Conversion

Lecture #4 Outline. Announcements Project Proposal. AVR Processor Resources

EEE3410 Microcontroller Applications Department of Electrical Engineering. Lecture 10. Analogue Interfacing. Vocational Training Council, Hong Kong.

The University of Texas at Arlington Lecture 10 ADC and DAC

DASL 120 Introduction to Microcontrollers

P a g e 1. Introduction

Embedded Hardware Design Lab4

Hardware and software resources on the AVR family for the microcontroller project

Design with Microprocessors

Roland Kammerer. 13. October 2010

8-bit Microcontroller with 1K Bytes Flash. ATtiny15. Advance Information. Features. Description. Pin Configurations

MICROPROCESSORS A (17.383) Fall Lecture Outline

ELG3336: Converters Analog to Digital Converters (ADCs) Digital to Analog Converters (DACs)

Analog I/O. ECE 153B Sensor & Peripheral Interface Design Winter 2016

Advantages of Analog Representation. Varies continuously, like the property being measured. Represents continuous values. See Figure 12.

Real Time Embedded Systems. Lecture 1 January 17, 2012

A Beginners Guide to AVR

Lecture 7: Analog Signals and Conversion

DEVELOPMENT OF REAL TIME DIGITAL CONTROLLER FOR A LIQUID LEVEL SYSTEM USING ATMEGA32 MICROCONTROLLER

UNIT III Data Acquisition & Microcontroller System. Mr. Manoj Rajale

Inductor saturation tester

Outline. Analog/Digital Conversion

Embedded Control. Week 3 (7/13/11)

AUR3840. Serial-interface, Touch screen controller. Features. Description. Applications. Package Information. Order Information

Inductor saturation tester

EECS 373 Design of Microprocessor-Based Systems

Lab 10. Speed Control of a D.C. motor

Notes on using the A/D Converter on the. FFMC8L/LC Microcontrollers. Fujitsu Mikroelektronik GmbH Vers. 1.0 by E. Bendels

Digital to Analog Conversion. Data Acquisition

uc Crash Course Whats is covered in this lecture Joshua Childs Joshua Hartman A. A. Arroyo 9/7/10

Analog to Digital Conversion

Hardware Platforms and Sensors

SD2085 Low Power HART TM Modem

ADC0808/ADC Bit µp Compatible A/D Converters with 8-Channel Multiplexer

ANALOG TO DIGITAL (ADC) and DIGITAL TO ANALOG CONVERTERS (DAC)

ELG4139: Converters Analog to Digital Converters (ADCs) Digital to Analog Converters (DACs)

Lecture 6: Digital/Analog Techniques

CONTENTS Sl. No. Experiment Page No

4 x 10 bit Free Run A/D 4 x Hi Comparator 4 x Low Comparator IRQ on Compare MX839. C-BUS Interface & Control Logic

Module 3. Embedded Systems I/O. Version 2 EE IIT, Kharagpur 1

AVR1300: Using the Atmel AVR XMEGA ADC. 8-bit Microcontrollers. Application Note. Preliminary. Features. 1 Introduction

University of Nairobi. Project Title A F OUR CHANNEL-D MICROCONTROLLER BASED DATA ACQUISITION SYSTEM WITH A SERIAL INTERFACE TO THE PC

Data Converters. Dr.Trushit Upadhyaya EC Department, CSPIT, CHARUSAT

A-D and D-A Converters

Electronics II Physics 3620 / 6620

Next Generation SAR ADC Simplifies Precision Measurement

AVR126: ADC of megaavr in Single-Ended Mode

Microcomputers. Digital Signal Processing

Serial communication inverter. Lab bench scenario. Inverter Board, A/D, D/A, PWM, Filters, Encoders. Inverter board. and Dimmer introduction

SD2017 Low Power HART TM Modem

Using the ADC0808 ADC Bit mp Compatible A D Converters with 8-Channel Analog Multiplexer

EEE312: Electrical measurement & instrumentation

Getting Precise with MSP430 Sigma-Delta ADC Peripherals Vincent Chan MSP430 Business Development Manager TI Asia

MEASUREMENT OF RELATIVE HUMIDITY USING A SIMPLE ARRANGEMENT & BY ANALOG TO DIGITAL DATA CONVERSION METHOD

Data Converters. Lecture Fall2013 Page 1

Lab Exercise 6: Digital/Analog conversion

EECS 373 Design of Microprocessor-Based Systems

Analog Interface 8.1 OVERVIEW 8 1

Computerized Data Acquisition Systems. Chapter 4

Linear Integrated Circuits

EE 109 Midterm Review

ME 461 Laboratory #3 Analog-to-Digital Conversion

EECS 140/240A Final Project spec, version 1 Spring 17. FINAL DESIGN due Monday, 5/1/2017 9am

Working with ADCs, OAs and the MSP430

HART Modem DS8500. Features

FIRSTRANKER. 1. (a) What are the advantages of the adjustable voltage regulators over the fixed

ADC Bit High-Speed µp-compatible A/D Converter with Track/Hold Function

ATmega 16. Dariusz Chaberski

Multiplexer Options, Voltage Reference, and Track/Hold Function

Fig 1: The symbol for a comparator

PIC ADC to PWM and Mosfet Low-Side Driver

8-Bit, high-speed, µp-compatible A/D converter with track/hold function ADC0820

ADC0808/ADC Bit µp Compatible A/D Converters with 8-Channel Multiplexer

Dedan Kimathi University of technology. Department of Electrical and Electronic Engineering. EEE2406: Instrumentation. Lab 2

Section 22. Basic 8-bit A/D Converter

PreLab 6 PWM Design for H-bridge Driver (due Oct 23)

AZ309. John Suchyta 8-Bit MCD Applications Engineer. June, 2007 Design Tips & Tricks for Analog Functions on 8-bit MCUs

8-bit Microcontroller with 2K Bytes In-System Programmable Flash. ATtiny261A. Appendix A. Appendix A ATtiny261A Specification at 105 C

MARMARA UNIVERSITY CSE315 DIGITAL DESIGN LABORATORY MANUAL. EXPERIMENT 7: Analog-to-Digital Conversion. Research Assistant Müzeyyen KARAMANOĞLU

Analytical Chemistry II

SD2057 Low Power HART TM Modem

EE445L Spring 2017 Final Page 1 of 7

ADC0808/ADC Bit µp Compatible A/D Converters with 8-Channel Multiplexer

Interfacing to Analog World Sensor Interfacing

Breadboard Arduino Compatible Assembly Guide

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

INTEGRATED CIRCUITS. AN109 Microprocessor-compatible DACs Dec

Analog/Digital and Sampling

THE PERFORMANCE TEST OF THE AD CONVERTERS EMBEDDED ON SOME MICROCONTROLLERS

Hello, and welcome to this presentation of the STM32G0 digital-to-analog converter. This block is used to convert digital signals to analog voltages

AK4180. Touch Screen Controller

Ch 8. Analog Interface

EE251: Tuesday October 10

CHAPTER ELEVEN - Interfacing With the Analog World

ADC Bit µp Compatible A/D Converter

ADC0816/ADC Bit μp Compatible A/D Converters with 16-Channel Multiplexer

All-Analog Digital Multimeter (DMM)

Transcription:

Module 13: Interfacing ADC Introduction ADC Programming DAC Programming Sensor Interfacing

Introduction

ADC Devices o Analog-to-digital converters (ADC) are among the most widely used devices for data acquisition. o Digital computer use binary (discrete), but physical world everything is analog (continuous). o Thus a device called transducer (sensor) is needed to convert physical quantities (i.e. temperature, pressure, etc) to electrical (voltage/current) signal. o ADC is used to translate the analog signals to digital signal.

ADC Characteristics o In ATmega32, an n-bit ADC is used to translate the analog signals to digital signal so that micro-p can read and process them. o Some of the major characteristics of ADC that we need to know. 1. Resolution ADC has n-bit resolution (8, 10, 12, 16..) Higher-resolution ADCs provide smaller step size- smallest change can be discerned by an ADC. Although ADC resolution is fixed, but the step size can be controlled by Vref.

2. Conversion time ADC Characteristics Conversion time is time ADC takes to convert the analog input to digital number. 3. Vref Vref is input voltage used for reference voltage. The voltage connected to this pin, along with ADC resolution, will dictate the step size. 4. Digital data output In an 8-bit ADC, we have an 8-bit digital data output of D0-D7. Thus, Dout:

ADC Characteristics 5. Parallel vs Serial ADC Parallel ADC 8 or more pins dedicated to bring out the binary data. Serial ADC Only one pin for data out.

ADC Characteristics 6. Analog input channel Many data acquisition application need more than one ADC. Thus, ADC chips comes with 2, 4, 8 or even 16 channels on a single chip. 7. Successive approximate ADC Widely used to convert analog input to digital input. Hass thee main components: successive approximation register (SAR); comparator; control unit.

ADC Programming

ATmega32 ADC Features o ADC peripheral of ATmega32 has the following characteristics: 1. 10-bit ADC. 2. Has 8 analog input channels, 7 differential input channels and 2 differential input channel with optional gain of 10x and 200x. 3. The converted output binary data is held by two special function registers: ADCL (A/D Result Low) & ADCH (A/D Result High). 4. Since ADCH:ADCL gives us 16-bit and ADC data out only 10-bit, thus remaining 6-bit is unused. 5. Three option for Vref. Vref connected to AVCC (analog Vcc); internal 2.6V reference;, external AREF pin. 6. Conversion time dictated by crystal frequency connected to XTAL and ADPS0:2 bits.

ADC Connection & Programming o Used inductor and capacitor in order to get a stable voltage source to the AVCC pin. o In ATmega32, five major registers are associated with ADC: 1. ADCH (high data) 2. ADCL (low data) Store result after conversion 3. ADCSRA (ADC Control and Status Register) 4. ADMUX (ADC multiplexer selection register) 5. SPIOR (Special Function I/O Register)

o There are three option for Vref selection: 1. AREF pin 2. AVCC pin 3. Internal 2.56V o The REFS1:0 bit 7:6 in ADMUX will determine the Vref. ADMUX Register

ADMUX Register o The MUX4:0 bit 4:0 in ADMUX will determine the analog channel and gain selection to be used. o Either single-ended or differential input can be selected to be converted to digital data. o If single-ended is selected, you can chooses input channel among ADC0 to ADC7 single pin is used as analog line, and GND as common ground.

ADMUX Register o If differential input is selected, you can chooses input channel as well as the op-amp gain: 1x, 10x, 200x.

ADMUX Register o The ADLAR bit 5 in ADMUX will determine either the left bits or the right bits of ADCH:ADCL registers used to store the result. o AVRs have a 10-bit ADC, but since two 8-bit registers dedicated to ADC result (ADCH:ADCL), thus 6 bits are unused and need to select position which bits are used and not. o Set One 1 : left justified. o Set Zero 0 : right justified.

ADCH:ADCL Registers o ADCH:ADCL registers are used to store the results after the A/D conversion is complete. o Since the ADC is 10-bit while ADCH:ADCL are 16-bit, we need to set the ADLAR bit of the ADMUX for making it right-justified or left-justified.

ADCSRA Register o The ADCSRA register is the status and control register of ADC.

ADCSRA Register o The ADPS2:0 Bit 2:0 : ADC Prescaler/Conversion time o These bits will determine the division factor between XTAL frequency and the input clock of ADC. o To select conversion time, we can select any of Fosc/2, Fosc/4, Fosc/8, Fosc/16, Fosc/32, Fosc/64 or Fosc/128 for ADC clock. o Fosc is the speed of the crystal frequency connected to AVR. o For the AVR, ADC requires an input clock frequency less than 200 KHz for the maximum accuracy.

ADCSRA Register

Steps Programming the ADC using Polling 1. Make the pin for selected ADC channel as an input pin. 2. Turn ON ADC module, since its disable upon power-on-reset to save power. 3. Select conversion speed ADPS2:0 4. Select voltage reference (REFS1:0) and ADC input channel (MUX4:0) in ADMUX register. 5. Activate start conversion bit write 1 to ADSC of ADCSRA register. 6. Wait for the conversion to be completed by polling the ADIF bit of ADCSRA register. 7. After ADIF = HIGH 1, read ADCH:ADCL to get digital data output. * read ADCL before ADCH. 8. If want to read the selected channel again, go back to step 5. 9. If want to select another Vref source or input channel, go back to step 4.

Steps Programming the ADC using Polling: Example

Steps Programming the ADC using Polling: Example

Steps Programming the ADC using Interrupt 1. Initialize interrupt vector table. 2. Make the pin for selected ADC channel as an input pin. 3. Turn ON ADC module, since its disable upon power-on-reset to save power. 4. Select conversion speed ADPS2:0 5. Select voltage reference (REFS1:0) and ADC input channel (MUX4:0) in ADMUX register. 6. Activate start conversion bit write 1 to ADSC of ADCSRA register. 7. Set ADIE = HIGH (A/D interrupt enable). Upon completion of conversion, ADIF changes to HIGH. 8. If ADIF = HIGH 1, it force CPU to jump to ADC interrupt handler to read ADCH:ADCL to get digital data output. * read ADCL before ADCH. 9. If want to read the selected channel again, go back to step 5. 10. If want to select another Vref source or input channel, go back to step 4.

Steps Programming the ADC using Interrupt

Steps Programming the ADC using Interrupt

DAC Programming

Digital-to-Analog Converter (DAC) o DAC widely used to convert digital pulses to analog signals. o There are two methods of creating DAC: 1. Binary weighted 2. R/2R ladder to achieve higher degree of precision. (DAC0808).

DAC0808 o In DAC0808, the digital inputs are converted to current (Iout), and by connecting resistor to the Iout, we convert the result to voltage. o Iref is the input current that must be applied to pin 14.

Sensor Interfacing