Workshop 3. Digital-to-analog and analog-to digital conversion

Slides:



Advertisements
Similar presentations
Analog to digital converter
Advertisements

Jordan Barry Victor Brzeski
Dr. Rabie A. Ramadan Al-Azhar University Lecture 3
Lizard Labs Peripheral Reflex System
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
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.
Instructor: Dr Aleksandar Milenkovic Lecture Notes
10-1 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi EE 319K Introduction to Embedded Systems Lecture 10: Sampling, Analog-to-Digital.
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.
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.
Slides created by: Professor Ian G. Harris Inputs and Outputs PIC Vcc RA3 RA4 RA5  Make an LED toggle state when button is pressed  Need to read RA3,
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.
ECT 357 Ch 10 Analog to Digital COnversion. Today’s Quote: It’s better to die with a good name than to live with a bad one. It’s better to die with a.
Interfacing ADC to 8051.
Analog to Digital Converters (ADC)
HT46 A/D Type MCU Series Data Memory (Byte) Program Memory HT46R22 (OTP) HT46C22 (Mask) 2Kx Kx16 4Kx HT46R23 (OTP) HT46C23 (Mask) HT46R24.
BLDC MOTOR SPEED CONTROL USING EMBEDDED PROCESSOR
DEEPAK.P MICROPROCESSORS AND APPLICATIONS Mr. DEEPAK P. Associate Professor ECE Department SNGCE 1.
Data Converters ELEC 330 Digital Systems Engineering Dr. Ron Hayne
1 ARM University Program Copyright © ARM Ltd 2013 Analog Interfacing.
AT91 Embedded Peripherals
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.
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
SIGMA-DELTA ADC SD16_A Sigma-Delta ADC Shruthi Sujendra.
1 LHO 13 The 8051CF020 and the University Daughter Card.
Renesas Electronics Corporation © 2010 Renesas Electronics America Inc. All rights reserved. RX 12 Bit Analog-to-Digital Converter A Rev /1/10.
Features of the new Alibava firmware: 1. Universal for laboratory use (readout of stand-alone detector via USB interface) and for the telescope readout.
IO Subsystem IV Ports and peripherals. IO Subsystem (1) All devices connected to the system buses, other than memory and CPU – Input and output ports.
The Silicon Laboratories C8051F020
Embedded Network Interface (ENI). What is ENI? Embedded Network Interface Originally called DPO (Digital Product Option) card Printer without network.
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.
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
Lab 3: ADC.
Embedded Systems Design 1 Lecture Set C Interfacing the MCS-51 to: –D/A Converter –A/D Converter.
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.
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.
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),
EE 319K Introduction to Embedded Systems
MADEIRA Valencia report V. Stankova, C. Lacasta, V. Linhart Ljubljana meeting February 2009.
 Mini-Computer ◦ Microprocessor  The Brains  Arithmetic Logic Unit (ALU)  Control Unit  Program/ Data Storage  Peripherals (Input/Output)  Low-Cost.
Lizard Labs Peripheral Reflex System
Digital-to-Analog Analog-to-Digital
Peripherals and CMSIS STM32F4, Cortex M
Outline Analog to digital conversion (ADC) of NuMaker TRIO
Analog Comparator An analog comparator is available on pins PE2(AIN0), PE3(AIN1) The comparator operates like any other comparator. -when (+) exceeds (-)
ECE 353 Introduction to Microprocessor Systems
Chapter 13 Linear-Digital ICs
ADC,DAC and sensor interface
Programming Microcontroller ADC – Analog Digital Converter
ADC, DAC, and Sensor Interfacing
Embedded Systems Software Training Center
Dr. Michael Nasief Lecture 2
ADC, DAC, and Sensor Interfacing
Subject Name: Digital Signal Processing Algorithms & Architecture
Chapter 7 Features and Interfacing of Programmable Devices for 8085 based systems.
ADC, DAC, and Sensor Interfacing
Simple ADC structures.
ADC, DAC, and Sensor Interfacing
Digital Control Systems Waseem Gulsher
CPE 323 Introduction to Embedded Computer Systems: DMA Controller
Lecture 13 A/D Converter & D/A Converter
ADC and DAC Data Converter
MSP432™ MCUs Training Part 6: Analog Peripherals
Pondicherry Engineering College
Prof. Chung-Ta King Department of Computer Science
ADC and DAC Data Converter
Presentation transcript:

Workshop 3. Digital-to-analog and analog-to digital conversion Embedded Systems Software Training Center Workshop 3. Digital-to-analog and analog-to digital conversion COPYRIGHT © 2015 DSR CORPORATION

Objectives Learn how to measure voltage with ADC. Learn how to generate analog signal with DAC Perform a test task. Copyright © 2015 DSR Corporation

Test task: Configure PA5 as an output pin. Measure voltage on PA1 (ADC123_IN1). Change voltage using variable resistor and indicate voltage level using LEDs. Additional task for self development: Configure DAC channel 2 (PA5) and generate signal changing from 0 to MAX and back. Copyright © 2015 DSR Corporation

STM32 ADC 12-bit, 10-bit, 8-bit or 6-bit configurable resolution Interrupt generation at the end of conversion, end of injected conversion, and in case of analog watchdog or overrun events Single and continuous conversion modes Scan mode for automatic conversion of channel 0 to channel ‘n’ Configurable DMA data storage in Dual/Triple ADC mode Configurable delay between conversions in Dual/Triple interleaved mode ADC conversion type (refer to the datasheets) ADC supply requirements: 2.4 V to 3.6 V at full speed and down to 1.8 V at slower speed ADC input range: VREF– <=VIN <= VREF+ Copyright © 2015 DSR Corporation

SPL ADC driver common configuration 1. Declare ADC_CommonInitStructure ADC_CommonInitTypeDef ADC_CommonInitStructure; /*ADC Common Init structure definition */ 2. Fill ADC_CommonInitStructure /*Configures the ADC to operate in independent or multi mode. */ ADC_CommonInitStructure.ADC_Mode = ADC_Mode_Independent; /*Select the frequency of the clock to the ADC. The clock is common for all the ADCs */ ADC_CommonInitStructure.ADC_Prescaler = ADC_Prescaler_Div2; /*Configures the Direct memory access mode for multi ADC mode.*/ ADC_CommonInitStructure.ADC_DMAAccessMode = ADC_DMAAccessMode_Disabled; /*Configures the Delay between 2 sampling phases.*/ ADC_CommonInitStructure.ADC_TwoSamplingDelay = ADC_TwoSamplingDelay_5Cycles; 3. Initializes the ADCs peripherals according to the specified parameters in the ADC_CommonInitStruct. ADC_CommonInit(&ADC_CommonInitStructure); Copyright © 2015 DSR Corporation

SPL ADC driver configuration 1. Declare ADC_InitStructure ADC_InitTypeDef ADC_InitStructure; 2. Fill ADC_InitStructure /* Configures the ADC resolution dual mode.*/ ADC_InitStructure.ADC_Resolution = ADC_Resolution_8b; /* Specifies whether the conversion is performed in Scan (multichannels) or Single (one channel) mode.*/ ADC_InitStructure.ADC_ScanConvMode = DISABLE; /* Specifies whether the conversion is performed in Continuous or Single mode */ ADC_InitStructure.ADC_ContinuousConvMode = ENABLE; /*Select the external trigger edge and enable the trigger of a regular group.*/ ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_None; /* Select the external event used to trigger the start of conversion of a regular group. */ ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T1_CC1; Copyright © 2015 DSR Corporation

SPL ADC driver configuration (continue) /*Specifies whether the ADC data alignment is left or right.*/ ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; /*Specifies the number of ADC conversions that will be done using the sequencer for regular channel group. */ ADC_InitStructure.ADC_NbrOfConversion = 1; 3. Initializes the ADCx peripheral according to the specified parameters in the ADC_InitStruct ADC_Init(ADC1, &ADC_InitStructure); 4. Configures for the selected ADC regular channel its corresponding rank in the sequencer and its sample time. ADC_RegularChannelConfig(ADC1, ADC_Channel_1, 1, ADC_SampleTime_144Cycles); 5. Enables or disables the specified ADC peripheral. ADC_Cmd(ADC1, ENABLE); Copyright © 2015 DSR Corporation

ADC operation 1. Enable the ADC interface clock using RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADCx, ENABLE); 2. ADC pins configuration Enable the clock for the ADC GPIOs: Configure these ADC pins in analog mode using GPIO_Init(); 3. Provide ADC initialization and configuration 4. To start ADC conversion call ADC_SoftwareStartConv(ADCx); 5. Wait for the end of conversion while(!(ADCx->SR & ADC_SR_EOC)) {}; 6. Read conversion result from ADC1->DR. Copyright © 2015 DSR Corporation

Thank you! COPYRIGHT © 2015 DSR CORPORATION 9