Programming Microcontroller ADC – Analog Digital Converter

Slides:



Advertisements
Similar presentations
Analog to digital converter
Advertisements

MS_uC / dnd / V RTC - Real Time Clock Programming Microcontroller CAN – Analog Digital Converter Autumn term K Byte Burst Flash 64K or 96K.
Jordan Barry Victor Brzeski
Georgia Tech Digital Back-end µHRG interface Curtis Mayberry School of Electrical and Computer Engineering Georgia Institute of Technology January 13 th,
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.
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.
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 Converters (ADC)
MS_uC / dnd / V RTC - Real Time Clock Programming Microcontroller ADC – Analog Digital Converter Autumn term K Byte Burst Flash 64K or 96K.
MS_uC / dnd / V Programming and GPIO Programming Microcontroller IDE usage, debugger GPIO – General Purpose Input/Output Week 2 - autumn term 2007.
MS_uC / dnd / V TIM - Timer Programming Microcontroller TIM - Timer Autumn term K Byte Burst Flash 64K or 96K Byte SRAM 256K or 512K Byte.
HT46 A/D Type MCU Series Data Memory (Byte) Program Memory HT46R22 (OTP) HT46C22 (Mask) 2Kx Kx16 4Kx HT46R23 (OTP) HT46C23 (Mask) HT46R24.
MS_uC / dnd / V VIC - Vectored Interrupts Programming Microcontroller VIC – Vectored interrupt controller Autumn term K Byte Burst Flash.
MS_uC / dnd / V RTC - Real Time Clock Programming Microcontroller RTC – Real Time Clock Autumn term K Byte Burst Flash 64K or 96K Byte SRAM.
NS Training Hardware. System Controller Module.
Hardware Overview Net+ARM – Well Suited for Embedded Ethernet
DEEPAK.P MICROPROCESSORS AND APPLICATIONS Mr. DEEPAK P. Associate Professor ECE Department SNGCE 1.
Renesas Electronics Europe GmbH A © 2010 Renesas Electronics Corporation. All rights reserved. RL78 Clock Generator.
LPC2148 Programming Using BLUEBOARD
1 ARM University Program Copyright © ARM Ltd 2013 Analog Interfacing.
Samsung ARM S3C4510B Product overview System manager
Digital to Analogue Converter
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
NS7520.
1 General Purpose and Alternate Function I/O (GPIO and AFIO)
Features of the new Alibava firmware: 1. Universal for laboratory use (readout of stand-alone detector via USB interface) and for the telescope readout.
By James Cockrell and Justin Loveless
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
Device Overview 1.  The advantages of all PIC18Fxxxx microcontrollers:  High computational performance  High-endurance  Enhanced Flash program memory.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an introduction to the peripheral functions.
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.
Renesas Electronics Europe GmbH A © 2010 Renesas Electronics Corporation. All rights reserved. RL78 AD converter.
STM32 및 개발보드 소개 Jang Hyunsung Embedded Systems Lab. Dept. of CSE, PNU
2D-Graphic Accelerator
THE MOST SUCCESSFUL C2000 MCU
Lizard Labs Peripheral Reflex System
Cypress Roadmap: Platform PSoC®
Outline Introduction to NuMaker TRIO Programming environment setup
Popular Microcontrollers and their Selection by Lachit Dutta
Workshop 3. Digital-to-analog and analog-to digital conversion
Microcontrollers & GPIO
Refer to Chapter 10 in the reference book
NS Training Hardware.
Atmel ARM I/O Programming
ADC, DAC, and Sensor Interfacing
Programming Microcontroller
Programming Microcontroller
Programming Microcontroller GPIO – General Purpose Input/Output
The Arduino Microcontroller: Atmel AVR Atmega 328
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
AT91 Memory Interface This training module describes the External Bus Interface (EBI), which generatesthe signals that control the access to the external.
ADC, DAC, and Sensor Interfacing
Getting the Most Out of Low Power MCUs
I2C Protocol and RTC Interfacing
CPE 323 Introduction to Embedded Computer Systems: DMA Controller
Lecture 13 A/D Converter & D/A Converter
嵌入式微控制器编程 Embedded Microcontroller Programming
ADC and DAC Data Converter
MSP432™ MCUs Training Part 6: Analog Peripherals
Pondicherry Engineering College
AVR – ATmega103(ATMEL) Architecture & Summary
ANALOG TO DIGITAL CONVERTER (ATD).
Wireless Embedded Systems
Prof. Chung-Ta King Department of Computer Science
ADC and DAC Data Converter
Presentation transcript:

Programming Microcontroller ADC – Analog Digital Converter 3- 1 Programming Microcontroller ADC – Analog Digital Converter Week 3 – Spring Term 2017 32K Byte Burst Flash 64K or 96K Byte SRAM 256K or 512K Byte Burst Flash OTP Mem UART I2C SPI TIM RTC EXT. Bus GPIO USB 2.0FS CAN 2.0B Enet MAC PFQ BC DMA INTR Cntl ARM966E CORE w/DSP 96 MHz CLK Cntl ADC LVD BOD PLL JTAG ETM9 STM32F407

ADC Specifics 12-bit, 10-bit, 8-bit or 6-bit configurable resolution 3- 2 12-bit, 10-bit, 8-bit or 6-bit configurable resolution Interrupt generation Single and continuous conversion modes Scan mode for automatic conversion of channel 0 to channel ‘n’ Data alignment with in-built data coherency Channel-wise programmable sampling time External trigger option with configurable polarity for both regular and injected conversions Discontinuous mode Dual/Triple mode (on devices with 2 ADCs or more) 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+ DMA request generation during regular channel conversion

ADC Block diagram (page 389/1745) 3- 3

ARM Peripheral Bus 2 access (APB2) ADC ARM Peripheral Bus 2 access (APB2) 2- 4 Reference Page 72/185 of “STM32F405xx STM32F407xx” “Datasheet – production data”

STM32F40x pin and ball definitions ADC 2- 5 Reference: page 45/185 of “STM32F405xx STM32F407xx” “Datasheet – production data”

ADC register map (431/1745 of RM0090) 3- 6

ADC Status Register (ADC_SR) (416/1745 of RM0090) 3- 7 Address Offset : 0 EOC : Regular channel end of conversion 0 : Conversion not complete 1 : Conversion complete

ADC Control Register 1 (ADC_CR1) (416/1745 of RM0090) 3- 8 Address offset : 0x04 RES : Resolution 00 : 12-bit (15 ADCCLK cycles) 01 : 01: 10-bit (13 ADCCLK cycles) 10 : 10: 8-bit (11 ADCCLK cycles) 11 : 6-bit (9 ADCCLK cycles)

ADC Control Register 2 (ADC_CR2) (418/1745 of RM0090) 3- 9 Address offset : 0x08 ADON : A/D Converter ON / OFF 0 : Disable ADC conversion and go to power down mod 1 : Enable ADC SWSTART : Start conversion of regular channels 0: Reset state 1: Starts conversion of regular channels

ADC sample time register 1 & 2 (420/1745 of RM0090) 3- 10 Address offset : 0x0C & 0x10 SMPx[2:0] : Channel x sampling time selection 000: 3 cycles 001: 15 cycles 010: 28 cycles 011: 56 cycles 100: 84 cycles 101: 112 cycles 110: 144 cycles 111: 480 cycles

ADC regular sequence registers 1, 2 & 3 (423/1745 of RM0090) 3- 11 Address offset : 0x2C, 0x30 & 0x34 L[3:0] : Regular channel sequence length 0000: 1 conversion 0001: 2 conversions ... 1111: 16 conversions SQx[4:0] : 16th conversion in regular sequence Channel number (0..18) assigned as the xth conversion sequence

ADC Regular Data Register (ADC_DR) (425/1745 of RM0090) 3- 12 Address offset: 0x4C DATA[15:0] : Regular data

ADC Initialization of pin PB0 3- 13 GPIOB Module GPIO Mode Register (GPIOx_MODER) Choose analog mode for the pin 0 (MODER0[1:0] = 0b11) GPIO port pull-up/pull-down register (GPIOx_PUPDR) Choose pull-up for the pin 0 (PUPDR0[1:0] = 0b01) ADC1 Module ADC Control Register 1 (ADC_CR1) Set the conversion resolution to 10 bits (RES[1:0] = 0b01) ADC Control Register 2 (ADC_ACR2) Switch the converter on (ADON = 0b1) ADC Sample Time Registers (ADC_SMPR1 & ADC_SMPR2) Set the sampling time for the channel 8 to 15 cycles (SMP8[2:0] = 0b001) ADC Regular Sequence Registers (ADC_SQR1 … ADC_SQR3) Choose the channel 8 for the first sequence (SQ1[4:0] = 0b01000)

Start an ADC Conversion on PB0 3- 14 ADC1 Module ADC Control Register 2 (ADC_ACR2) Start a conversion with the SWSTART bit ADC Status Register (ADC_SR) Wait until the conversion has been realized (EOC bit) ADC Regular Data Register(ADC_DR) Read the conversion result