10-1 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi EE 319K Introduction to Embedded Systems Lecture 10: Sampling, Analog-to-Digital.

Slides:



Advertisements
Similar presentations
EE 319K Introduction to Embedded Systems
Advertisements

Interfacing to the Analog World
11-1 Bard, Gerstlauer, Valvano, Yerraballi EE 319K Introduction to Embedded Systems Lecture 11: Data Acquisition, Numerical Fixed-Point Calculations, Lab.
13-1 Bard, Gerstlauer, Valvano, Erez, Telang, Yerraballi EE 319K Introduction to Embedded Systems Lecture 13: 2-D Arrays, Bitmaps, Sprites, Structs, Lab.
Jordan Barry Victor Brzeski
4-1 EE 319K Introduction to Embedded Systems Lecture 4: Arithmetic overflow, Branches, Control Structures, Abstraction & Refinement Bard, Erez, Gerstlauer,
Sistemi Elettronici Programmabili13-1 MULTI OSC + CLOCK FILTER LVD POWER SUPPLY CONTROL 8 BIT CORE ALU PROGRAM MEMORY RAM I2CI2C PORT A SPI PORT B 16-BIT.
EET 252 Unit 6 Analog-to-Digital Conversion
12-1 EE 319K Introduction to Microcontrollers Lecture 12: A/D Conversion and Lab 8 Read Book Sections 10.2 and 11.4.
Digital Fundamentals Tenth Edition Floyd Chapter 12.
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 14.
COMP3221: Microprocessors and Embedded Systems
Analog to Digital Conversion. 12 bit vs 16 bit A/D Card Input Volts = A/D 12 bit 2 12 = Volts = Volts = 2048 −10 Volts = 0 Input Volts.
Analog Comparator Positive input chooses bet. PB2 and Bandgap Reference. Negative input chooses bet. PB3 and the 8 inputs of the A/D. ACME= Analog Comparator.
Lecture 9: D/A and A/D Converters
AD Converter UNIT 19 로봇 SW 교육원 조용수. 학습 목표 AD Converter AD Converter Register 2.
Analogue to Digital Conversion
1 Analog to Digital Conversion Lecture 8. 2 In These Notes... Analog to Digital Converters –ADC architectures –Sampling/Aliasing –Quantization –Inputs.
5-1 Analogue Input/Output Many sensors/transducers produce voltages representing physical data.  To process transducer data in a computer requires conversion.
Data acquisition and manipulation
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.
Analog-to-Digital Converter (ADC)
Analogue to Digital Conversion
Introduction to Data Conversion
Discussion #25 – ADCECEN 3011 Conversion Mosiah 5:2 2 And they all cried with one voice, saying: Yea, we believe all the words which though has spoken.
EET260: A/D and D/A converters
11-1 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi EE 319K Introduction to Embedded Systems Lecture 11: Data Acquisition, Numerical.
6-1 EE 319K Introduction to Embedded Systems Lecture 6: SysTick Timer, Exam 1 Review Bard, Erez, Gerstlauer, Valvano, Yerraballi, Telang, Janapa Reddi,
Data Acquisition. Data Acquisition System Analog Signal Signal Conditioner ADC Digital Processing Communication.
EE 319K Introduction to Embedded Systems
11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou.
Data Converters ELEC 330 Digital Systems Engineering Dr. Ron Hayne
Analog to Digital Converters (ADC) 1
Digital to Analogue Converter
Lecture 13 A/D Converter & D/A Converter. Outline Basic Operation Single Scan Mode Continuous Scan Mode Group Scan Mode Interrupt Sources Registers D/A.
Data Acquisition Systems
ELN5622 Embedded Systems Class 7 Spring, 2003 Aaron Itskovich
SIGMA-DELTA ADC SD16_A Sigma-Delta ADC Shruthi Sujendra.
Lecture 2 Silicon Labs C8051F020 System Overview.
Revised: Aug 1, ECE 263 Embedded System Design Lessons HC12 Analog-to-Digital (ATD) Converter System.
1 LHO 13 The 8051CF020 and the University Daughter Card.
Data Acquisition ET 228 Chapter 15 Subjects Covered Analog to Digital Converter Characteristics Integrating ADCs Successive Approximation ADCs Flash ADCs.
The Silicon Laboratories C8051F020
CS224 I/O. Timers Timer1 is 16-bit timer 2^16-1 or 65,535 SYSCLK = 40MHz, Prescalers – 1:1, 1:8, 1:64, and 1:256 – Use T1CONbits.TCKPS=3 for 1:256 scaling.
Light Sensors ECE 4437 Dr. J. Glover Team 9: Jitin George Zachary Freeman.
1 Data-Converter Circuits A/D and D/A Chapter 9 1.
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
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the serial communication.
Analog/Digital Conversion
ECE 2799 Electrical and Computer Engineering Design ANALOG to DIGITAL CONVERSION Prof. Bitar Last Update:
Embedded Control Systems Dr. Bonnie Heck School of ECE Georgia Tech.
Embedded Systems Design 1 Lecture Set C Interfacing the MCS-51 to: –D/A Converter –A/D Converter.
Closed Loop Temperature Control Circuit with LCD Display Mike Wooldridge ECE 4330 Embedded Systems.
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.
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
Lecture Notes / PPT UNIT III
EE 319K Introduction to Embedded Systems
Analog-Digital Conversion. Analog outputs from sensors and analog front- ends (analog signal conditioning) have to be converted into digital signals.
Renesas Electronics Europe GmbH A © 2010 Renesas Electronics Corporation. All rights reserved. RL78 AD converter.
8-1 Embedded Systems Analog to Digital Conversion Lecture 8.
FOR MORE CLASSES VISIT   ECET 340 Week 1 HomeWork 1  ECET 340 Week 1 iLab 1  ECET 340 Week 2 HomeWork 2  ECET 340 Week 2 iLab.
EE 319K Introduction to Embedded Systems
Analog-to-Digital Converter
Signal conditioning.
ECET 340 Competitive Success/snaptutorial.com
ECET 340 Education for Service-- snaptutorial.com.
ECET 340 Teaching Effectively-- snaptutorial.com.
CSCI1600: Embedded and Real Time Software
Presentation transcript:

10-1 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi EE 319K Introduction to Embedded Systems Lecture 10: Sampling, Analog-to-Digital Conversion

10-2 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi Agenda  Recap  Local Variables  Stack frames  Recursion  Fixed-point numbers  LCD device driver (Lab 7)  Outline  Sampling, Nyquist theorem  Analog to Digital Conversion

10-3 Analog to Digital Converter (ADC) Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

10-4 Nyquist Theorem  A bandlimited analog signal that has been sampled can be perfectly reconstructed from an infinite sequence of samples if the sampling rate f s exceeds 2f max samples per second, where f max is the highest frequency in the original signal.  If the analog signal does contain frequency components larger than (1/2)f s, then there will be an aliasing error.  Aliasing is when the digital signal appears to have a different frequency than the original analog signal.  Valvano Postulate: If f max is the largest frequency component of the analog signal, then you must sample more than ten times f max in order for the reconstructed digital samples to look like the original signal when plotted on a voltage versus time graph. Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

10-5 Sampling (option 1)  200Hz signal sampled at 2000Hz Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

10-6 Sampling (option 1)  1000Hz signal sampled at 2000Hz Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

10-7 Sampling (option 1)  2200Hz signal sampled at 2000Hz Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi This is aliasing

10-8 Sampling (option 2)  100Hz signal sampled at 1600Hz Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

10-9 Sampling (option 2)  A signal with DC, 100Hz and 400Hz sampled at 1600Hz Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

10-10 Sampling (option 2)  1500Hz signal sampled at 1600Hz Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi This is aliasing

10-11 Analog to Digital Converter (ADC)  Successive approximation ADC  V IN is approximated as a static value in a sample and hold (S/H) circuit  the successive approximation register (SAR) is a counter that increments each clock as long as it is enabled by the comparator  the output of the SAR is fed to a DAC that generates a voltage for comparison with V IN  when the output of the DAC = V IN the value of SAR is the digital representation of V IN end of conversion Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

10-12 Sample-And-Hold Circuit  Analog Input (AI) is sampled when the switch is closed and its value is held on the capacitor where it becomes the Analog Output (AO) S/H Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

10-13 ADC on TM4C123  Sampling Range/Resolution  3.3V internal reference voltage  0x000 at 0 V input  0xFFF at 3.3 V  resolution = range/precision = 3.3V/4096 alternatives < 1mV Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

10-14  Twelve analog input channels  Single-ended and differential-input configurations  On-chip internal temperature sensor  Sample rate up to one million samples/second 40 Hz  Flexible, configurable analog-to-digital conversion  Four programmable sample conversion sequences from one to eight entries long, with corresponding conversion result FIFOs  Flexible trigger control  Controller (software) We will use software initiated trigger  Timers  Analog Comparators  PWM  GPIO  Hardware averaging of up to 64 samples for improved accuracy  Converter uses an internal 3V reference Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi ADC on TM4C123 PE2=Ain1 used for Lab 8, 9, 10

10-15 ADC on TM4C123 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi Ain1 PE2 Software initiated Bit 3 is done flag Use sequencer 3 PE2=Ain1 used for Lab 8, 9, 10

10-16 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi ADC on TM4C123 Twelve different pins can be used to sample analog inputs. PD4=Ain4 used for DLL testing PE2=Ain1 used for Lab 8, 9, 10 PE4=Ain9 used in book and ADCSWTrigger_4C123

10-17 ADC on TM4C123  TM4C ADC registers Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

10-18 ADC on TM4C123  TM4C123 ADC Operation  select rate  select sequencer  select trigger  select channel  select sample mode o0 not temperature o1 set completion flag o1 end sequence o0 not differential Speed bits in ADC0_PC_R EM3, EM2, EM1, and EM0 bits in ADC_EMUX_R Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi ADC0_SSCTL3_R = 0x06;

10-19 ADC on TM4C123  Initialization  Enable ADC clock: set bit 0 in SYSCTL_RCGCADC_R  Set 125kHz ADC conversion speed: write 0x01 to ADC0_PC_R  Set sequencer priority: 0,1,2,3 in ADC0_SSPRI_R  Disable selected sequence 3: zero bit 3 of ADC0_ACTSS_R  Set software start trigger event: zero bits of ADC0_EMUX_R  Set input source (0-11): write channel number in bits 3-0 of ADC0_SSMUX3_R (channel 9 is PE4, channel 1 is PE2)  Set sample control bits: write 0110 in bits 3-0 ADC0_SSCTL3_R to disable temp measurement, notify on sample complete, indicate single sample in sequence, and denote single-ended signal mode  Disable interrupts: zero bit 3 of ADC0_IM_R  Enable selected sequencer 3: set bit 3 of ADC0_ACTSS_R Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

10-20 ADC on TM4C123 Channel 9 is PE4 void ADC0_InitSWTriggerSeq3_Ch9(void){ SYSCTL_RCGCGPIO_R |= 0x10; // 1) activate clock for Port E while((SYSCTL_PRGPIO_R&0x10) == 0){}; GPIO_PORTE_DIR_R &= ~0x10; // 2) make PE4 input GPIO_PORTE_AFSEL_R |= 0x10; // 3) enable alternate fun on PE4 GPIO_PORTE_DEN_R &= ~0x10; // 4) disable digital I/O on PE4 GPIO_PORTE_AMSEL_R |= 0x10; // 5) enable analog fun on PE4 SYSCTL_RCGCADC_R |= 0x01; // 6) activate ADC0 delay = SYSCTL_RCGCADC_R; // extra time to stabilize delay = SYSCTL_RCGCADC_R; ADC0_PC_R = 0x01; // 7) configure for 125K ADC0_SSPRI_R = 0x0123; // 8) Seq 3 is highest priority ADC0_ACTSS_R &= ~0x0008; // 9) disable sample sequencer 3 ADC0_EMUX_R &= ~0xF000; // 10) seq3 is software trigger ADC0_SSMUX3_R = (ADC0_SSMUX3_R&0xFFFFFFF0)+9; // 11) Ain9 (PE4) ADC0_SSCTL3_R = 0x0006; // 12) no TS0 D0, yes IE0 END0 ADC0_IM_R &= ~0x0008; // 13) disable SS3 interrupts ADC0_ACTSS_R |= 0x0008; // 14) enable sample sequencer 3 } Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi Book shows Ain9=PE4 Lab 8, 9, 10 use Ain1=PE2

10-21 ADC on TM4C123  Analog to digital conversion  Set software trigger oWrite to PSSI bit 3  Busy-Wait oRaw Interrupt Status = RIS bit 3 oPoll until sample complete  Read sample oRead from SSFIFO3  Clear sample complete flag oWrite to ISC bit 3 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi

10-22 // ADC_InSeq // Busy-wait analog to digital conversion // Input: none // Output: 12-bit result of ADC conversion uint32_t ADC0_InSeq3(void){ uint32_t data; ADC0_PSSI_R = 0x0008; while((ADC0_RIS_R&0x08)==0){}; data = ADC0_SSFIFO3_R&0xFFF; ADC0_ISC_R = 0x0008; return data; } ADC on TM4C123 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi