ADC, DAC, and Sensor Interfacing

Slides:



Advertisements
Similar presentations
Interfacing to the Analog World
Advertisements

Analog to Digital Conversion (ADC)
PROGRAMMABLE PERIPHERAL INTERFACE -8255
Programmable Interval Timer
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
Data Acquisition ET 228 Chapter
SPI Serial Peripheral Interface. SPI Serial Peripheral Interface is communication between two devices, one bit at a time sequential one bit at time over.
ECE 265 – LECTURE 14 Analog Signal Acquisition The A/D converters 5/14/ ECE265.
Analog/Digital Subsystem
Khaled A. Al-Utaibi  Digital Vs Analog Signals  Converting an Analog Signal to a Digital One  Reading Analog Sensors with the.
Oscilloscope Watch Teardown. Agenda History and General overview Hardware design: – Block diagram and general overview – Choice of the microcontroller.
5-1 Analogue Input/Output Many sensors/transducers produce voltages representing physical data.  To process transducer data in a computer requires conversion.
Explain the introduction to ADC, ADC characteristics, Programming ADC using PIC18, Introduction to DAC and DAC interfacing with PIC18.
1 Analog-to-Digital Converter (ADC). 2 ADC Features (1/3) ADC conversion rate 1 MHz and 12-bit resolution – 1µs conversion time at 56 MHz – 1.17µs conversion.
Interfacing ADC to 8051.
Analogue Input/Output
SVT TDR meeting – March 30, 2012 List of peripheral blocks for SVT strip readout chips.
Embedded System Design Laboratory October 11, 2002Stanford University - EE281 Lecture #4#1 Lecture #4 Outline Announcements Project Proposal AVR Processor.
Digital to Analogue Converter
ELN5622 Embedded Systems Class 7 Spring, 2003 Aaron Itskovich
Renesas Electronics Corporation © 2010 Renesas Electronics America Inc. All rights reserved. RX 12 Bit Analog-to-Digital Converter A Rev /1/10.
Data Acquisition ET 228 Chapter 15 Subjects Covered Analog to Digital Converter Characteristics Integrating ADCs Successive Approximation ADCs Flash ADCs.
Representing Numerical Data Analog Any signal that varies continuously over time Mechanical Pneumatic Hydraulic Electrical Digital Quantities are represented.
Suleyman Demirel University CSS340 Microprocessor Systems – Lecture 2 ATMEGA328P ARCHITECTURE ANALOG INPUTS.
The Silicon Laboratories C8051F020
Analog Capture- Port E. Digital to Analog and Analog to Digital Conversion D/A or DAC and A/D or ADC.
By James Cockrell and Justin Loveless
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
ECE 2799 Electrical and Computer Engineering Design ANALOG to DIGITAL CONVERSION Prof. Bitar Last Update:
Analog to Digital Converter (ADC)
8255:Programmable Peripheral Interface
0808/0809 ADC. Block Diagram ADC ADC0808/ADC Bit μP Compatible A/D Converters with 8-Channel Multiplexer The 8-bit A/D converter uses successive.
ADC 1 Analog to Digital Converter. ADC 2 ADC Features n General Features -Supports 8 or 10-bit resolution Modes, -Track period fully programmable up to.
By: Shivanshi pandya(30) Ayushi chourasia (3) Pranavi chhikniwala(6)
Chapter 7 ADC, DAC, and Sensor Interfacing 1. Microcontroller Connection to Sensor via ADC 2.
SAR ADC Tao Chen.
Workshop 3. Digital-to-analog and analog-to digital conversion
Analog-to-Digital Converter (ADC)
Analog Comparator An analog comparator is available on pins PE2(AIN0), PE3(AIN1) The comparator operates like any other comparator. -when (+) exceeds (-)
UNIT – Microcontroller.
Refer to Chapter 10 in the reference book
ADC,DAC and sensor interface
Interfacing of LCD with µP
Programming Microcontroller ADC – Analog Digital Converter
ADC, DAC, and Sensor Interfacing
DMA CONTROLLER 8257 Features: It is a 4-channel DMA.
ADC, DAC, and Sensor Interfacing
Introduction to Microprocessors and Microcontrollers
Chapter 7 Features and Interfacing of Programmable Devices for 8085 based systems.
STM Arm I/O Programming
SPI Protocol and DAC Interfacing
ADC, DAC, and Sensor Interfacing
Simple ADC structures.
ECE 354 Computer Systems Lab II
Atmel ARM Timer Programming
Simple ADC structures.
UART Serial Port Programming
I2C Protocol and RTC Interfacing
Digital Control Systems Waseem Gulsher
PIC18F458 Analog-to-Digital
Introducing the PIC Mid-Range Family and the 16F84A
Lecture 13 A/D Converter & D/A Converter
ADC and DAC Programming in AVR
ADC and DAC Data Converter
ADC and Sensor Programming
AVR – ATmega103(ATMEL) Architecture & Summary
FIGURE 1: SERIAL ADDER BLOCK DIAGRAM
Compiled by Dr. N.Shanmugasundaram, HOD, ECE Dept, SECE.
I2C and DAC Interfacing and Programming
ADC and DAC Data Converter
Presentation transcript:

ADC, DAC, and Sensor Interfacing Chapter 7 ADC, DAC, and Sensor Interfacing

Microcontroller Connection to Sensor via ADC

An 8-bit ADC Block Diagram

Resolution versus Step Size for ADC (Vref = 5V) n-bit Number of steps Step size 8 256 5V /256 = 19.53 mV 10 1024 5V /1024 = 4.88 mV 12 4096 5V /4096 = 1.2 mV 16 65,536 5V /65,536 = 0.076 mV Note: Vref = 5V

Vref Relation to Vin Range for an 8-bit ADC Vref (V) Vin in Range (V) Step Size (mV) 5.00 0 to 5 5 / 256 = 19.53 4.00 0 to 4 4 / 256 = 15.62 3.00 0 to 3 3 / 256 = 11.71 2.56 0 to 2.56 2.56 / 256 = 10 2.00 0 to 2 2 / 256 = 7.81 1.28 0 to 1.28 1.28 / 256 = 5 1.00 0 to 1 1 / 256 = 3.90 Note: In an 8-bit ADC, step size is Vref/256

Vref Relation to Vin Range for an 10-bit ADC Vref (V) VinRange (V) Step Size (mV) 5.00 0 to 5 5 / 1024 = 4.88 4.96 0 to 4.096 4.096 / 1024 = 4 3.00 0 to 3 3 / 1024 = 2.93 2.56 0 to 2.56 2.56 / 1024 = 2.5 2.00 0 to 2 2 / 1024 = 2 1.28 0 to 1.28 1.28 / 1024 = 1.25 1.024 0 to 1.024 1.024 / 1024 = 1 Note: In a 10-bit ADC, step size is Vref/1024

A Simultaneous 2-bit ADC

ADC0848 Parallel ADC Block Diagram

MAX1112 Serial ADC Block Diagram

Successive Approximation ADC

Some of the STM32F4xx Registers

Simplified Block Diagram of STM32F4xx chip

RCC_APB2ENR (RCC APB2 peripheral clock enable register) to enable clock to ADC Bit 10 ADC3EN : ADC3 clock enable This bit is set and cleared by software. 0: ADC3 clock disabled 1: ADC3 clock disabled Bit 9 ADC2EN : ADC2 clock enable 0: ADC2 clock disabled 1: ADC2 clock disabled Bit 8 ADC1EN : ADC1 clock enable This bit is set an d cleared by software. 0: ADC1 clock disabled 1: ADC1 clock disabled

ADC sample time register (ADC_SMPR1) to set sampling time

ADC sample time register (ADC_SMPR2) to set sampling time 000: 3 cycles 001: 15 cycles 010: 28 cycles 011: 56 cycles 100: 84 cycles 101: 112 cycles 110: 144 cycles 111: 480 cycles

Control 1 (ADC_CR1) Register (Not all bits are shown)

ADC bit Resolution Selection in ADC_CR1 register

Control R1 (ADC_CR1) Register bits for ADC Channel Selection

Analog input pin assignment in STM32F4xx

GPIO_MODER Register Bits 2y:2y+1 MODERy[1:0]: Port x configuration bits (y = 0..15) These bits are written by software to configure the I/O direction mode. 00: Input (reset state) 01: General purpose output mode 10: Alternate function mode 11: Analog mode

ADC_DR (ADC Data Register) register holds conversion result

ADC_DR (DATA) Register has the result and can be Right and Left Justified

ADC_CR2 (ADC Control 2) register

ADC_SR(ADC Status g) Register for End-of-Conversion

ADC_SR (Status) Register Bits

ADC Connection for Program 7-1

ADC common control register (ADC_CCR) register

ADC common control register (ADC_CCR) register Bit Field Descriptions 22 TSVREFE: Temperature Sensor and VREINT Enable This bit is set and cleared by software to enable/disable the temperature sensor and the VREFINT channel. 0: Temperature sensor and VREFINT channel disabled. 1: Temperature sensor and VREFINT channel enabled. 23 VBATE: VBAT enable VBAT enable 0: VBAT channel disabled. 1: VBAT channel enabled. 17:16   ADCPRE: ADC prescaler Set and cleared by software to select the frequency of the clock to the ADC. The clock is common for all the ADCs. 00: PCLK2 divided by 2 01: PCLK2 divided by 4 10: PCLK2 divided by 6 11: PCLK2 divided by 8

Thermistor Resistance vs. Temperature Temperature ('C) Tf (K ohms) 29.490 25 10.000 50 3.893 75 1.700 100 0.817

Thermistor (Copied from http://www.maximintegrated.com)

LM34 and LM35

Getting Data to the CPU

LM34/35 Connection to ARM and Its Pin Configuration

DAC Block Diagram

Microcontroller Connection to DAC0808

STM32F4xx DAC Block Diagram

DAC_CR (DAC Conntrol Register) Bit 18 TEN2 : DAC channel2 trigger enable This bit is set and cleared by software to enable/disable DAC channel2 trigger 0: DAC channel2 trigger disabled and data written into the DAC_DHRx register are transferred one APB1 clock cycle later to the DAC_DOR2 register 1: DAC channel2 trigger enabled and data from the DAC_DHRx register are transferred three APB1 clock cycles later to the DAC_DOR2 register Bit 17 BOFF2 : DAC channel2 output buffer disable This bit is set and cleared by software to enable/disable DAC channel2 output buffer. 0: DAC channel2 output buffer enabled 1: DAC channel2 output buffer disabled Bit 16 EN2 : DAC channel2 enable This bit is set and cleared by software to enable/disable DAC channel2. 0: DAC channel2 disabled 1: DAC channel2 enabled

DAC channel-x data holding- register (DAC_DHRx) DAC channel1 8-bit right aligned data holding register (DAC_DHR8R1) DAC channel2 8-bit right-aligned data holding register (DAC_DHR8R2) DAC channel1 12-bit right-aligned data holding register (DAC_DHR12R1) DAC channel2 12-bit right aligned data holding register (DAC_DHR12R2)

DAC channel1 data output register (DAC_DOR1)

DAC channel2 data output register (DAC_DOR2)

DAC software trigger register (DAC_SWTRIGR)

RCC APB1 Peripheral Clock Enable Register (RCC_APB1ENR) to enable clock to DAC

Saw Tooth Wave Form

Angle vs. Voltage Magnitude for Sine Wave (degrees) Sin Ɵ VOUT (Voltage Magnitude) 5V + (5V × sin Ɵ) Values Sent to DAC (decimal) (Voltage Mag. × 25.6) 5 128 30 0.5 7.5 192 60 0.866 9.33 238 90 1.0 10 255 120 150 180 210 -0.5 2.5 64 240 -0.866 0.669 17 270 -1.0 300 330 360

Angle vs. Voltage Magnitude for Sine Wave