6 - 1 Texas Instruments Incorporated Module 6 : Analogue Digital Converter C28x 32-Bit-Digital Signal Controller TMS320F2812.

Slides:



Advertisements
Similar presentations
Analog to digital converter
Advertisements

8086 [2] Ahad. Internal! External? 8086 vs _bit Data Bus 20_bit Address 8_bit Data Bus 20_bit Address Only external bus of 8088 is.
The 8051 Microcontroller and Embedded Systems
Mark Neil - Microprocessor Course 1 Device Drivers – Digital Voltmeter.
Chung-Ta King National Tsing Hua University
Programmable Keyboard/ Display Interface: 8279
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 to Digital Conversion
Kuliah Mikrokontroler AVR Comparator AVR Eru©September 2009 PENS.
Analog to Digital Convertor MTT48 V1.0 ADC - 1 ANALOG TO DIGITAL CONVERTOR (ADC)
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 Lab2: A/D Converter. 2 This circuit connects a variable voltage to an A/D port on the AVR mcu. Your software running on the AVR mcu will read the digital.
Introduction of Holtek HT-46 series MCU
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.
ECE 371 – Unit 15 Data Acquisition Systems A/Ds in MC9S12DPS56B Microcontroller.
Analog-to-Digital Converter (ADC)
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.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Renesas Electronics Europe GmbH A © 2010 Renesas Electronics Corporation. All rights reserved. RL78 Clock Generator.
1 Chapter 4 Timer Operation (I. Scott MacKenzie).
ARM Timers.
1 ATD10B8CV2 on MC9SI2C By: Yuchun Huang. 2 ADC ADC Power Supply.
8254 SOFTWARE PROGRAMMABLE TIMER/COUNTER
Unit 10.2 Timer Examples. Example – Music Generation Channel 6 – Set up as a timer Output to Generate Square Waves Channel 4 – Set up as a timer Output.
Event Manager Block Diagram (EVA)
Embedded System Design Laboratory October 11, 2002Stanford University - EE281 Lecture #4#1 Lecture #4 Outline Announcements Project Proposal AVR Processor.
Digital to Analogue Converter
Data Acquisition Systems
ELE2MIC Lecture 21 The AVR Sleep Modes ATMEGA128’s Analog to Digital Converter –Features –Block Diagram –Clock Source –Input Sources –Interrupts –BandGap.
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.
Bit-Digital Signal Controller TMS320F2812 Texas Instruments Incorporated Module 3: F28x –Digital I/O.
7 - 1 Texas Instruments Incorporated Module 7 : Serial Peripheral Interface C28x 32-Bit-Digital Signal Controller TMS320F2812.
4 - 1 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH) Module 4 : Interrupt System C28x 32-Bit-Digital.
The pin of ADC  12-bit ADC core with built-in dual sample- and-hold  Simultaneous sampling or sequential sampling modes  Analog input: 0 V to 3 V.
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
32-Bit-Digital Signal Controller Texas Instruments Incorporated
Chapter 5 - Interrupts.
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
Lab 3: ADC.
Device Overview 1.  The advantages of all PIC18Fxxxx microcontrollers:  High computational performance  High-endurance  Enhanced Flash program memory.
Lecture 4 General-Purpose Input/Output NCHUEE 720A Lab Prof. Jichiang Tsai.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an introduction to the peripheral functions.
Analog to Digital Converter (ADC)
Analog to Digital Conversion - ADC Mark Neil - Microprocessor Course 1 Device Drivers – Measuring Voltages.
Chapter Microcontroller
Computer Operating Properly Module MTT COMPUTER OPERATING PROPERLY MODULE (COP)
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.
EKT 314/4 WEEK 9 : CHAPTER 4 DATA ACQUISITION AND CONVERSION ELECTRONIC INSTRUMENTATION.
Renesas Electronics Europe GmbH A © 2010 Renesas Electronics Corporation. All rights reserved. RL78 AD converter.
Analog Comparator An analog comparator is available on pins PE2(AIN0), PE3(AIN1) The comparator operates like any other comparator. -when (+) exceeds (-)
Timer and Interrupts.
Prof. Chung-Ta King Department of Computer Science
8086 Microprocessor.
Programming Microcontroller ADC – Analog Digital Converter
ADC, DAC, and Sensor Interfacing
Chapter 7 Features and Interfacing of Programmable Devices for 8085 based systems.
8254 Timer and Counter (8254 IC).
전자의료시스템 및 실습 System Configuration/Interrupt
MSP432™ MCUs Training Part 6: Analog Peripherals
Pondicherry Engineering College
8253 – PROGRAMMABLE INTERVAL TIMER (PIT). What is a Timer? Timer is a specialized type of device that is used to measure timing intervals. Timers can.
ANALOG TO DIGITAL CONVERTER (ATD).
Device Drivers – Digital Voltmeter
Prof. Chung-Ta King Department of Computer Science
Programmable Interval Timer
Presentation transcript:

6 - 1 Texas Instruments Incorporated Module 6 : Analogue Digital Converter C28x 32-Bit-Digital Signal Controller TMS320F2812

6 - 2 ADC Module  12-bit resolution ADC core  Sixteen analog inputs (range of 0 to 3V)  Two analog input multiplexers  Up to 8 analog input channels each  Two sample/hold units (for each input mux)  Sequential and simultaneous sampling modes  Auto sequencing capability - up to 16 auto conversions  Two independent 8-state sequencers  “Dual-sequencer mode”  “Cascaded mode”  Sixteen individually addressable result registers  Multiple trigger sources for start-of-conversion  External trigger, S/W, and Event Manager events

6 - 3 ADC Module Block Diagram (Cascaded Mode) 12-bit A/D Converter ResultSelect Result MUX RESULT0... RESULT1 RESULT2 RESULT15 CHSEL00 (state 0) CHSEL01 (state 1) CHSEL02 (state 2) CHSEL03 (state 3) CHSEL15 (state 15)... MAX_CONV1 Auto sequencer Start Sequence Trigger SOC EOC SoftwareEVAEVB Ext Pin (ADCSOC) Analog MUX MUXA ADCINA0 ADCINA1 ADCINA7... MUXB ADCINB0 ADCINB1 ADCINB7... S/HA S/HMUX S/HB

6 - 4 ADC Module Block Diagram (Dual-Sequencer mode)

6 - 5 F2812 ADC Clocking Example CLKIN (30 MHz) HSPCLK (150 MHz) ADCCLKPS bitsADCTRL30011b FCLK (25 MHz) FCLK = HSPCLK/(2*ADCCLKPS) ADCCLK = FCLK/(CPS+1) ADCCLK (25 MHz) CPS bitADCTRL1 0b To ADC pipeline sampling window ACQ_PS bits ADCTRL1 0111b Important: ADCCLK can be a maximum of 25 MHz! SYSCLKOUT (150 MHz) PLLCR DIV bits 1010b To CPU sampling window = (ACQ_PS + 1)*(1/ADCCLK) PCLKCR.ADCENCLK = 1 HISPCP HSPCLK bits 000b

6 - 6 Analog-to-Digital Converter Registers ADCTRL1 0x ADC Control Register 1 ADCTRL2 0x ADC Control Register 2 ADCMAXCONV 0x ADC Maximum Conversion Channels Register ADCCHSELSEQ1 0x ADC Channel Select Sequencing Control Register 1 ADCCHSELSEQ2 0x ADC Channel Select Sequencing Control Register 2 ADCCHSELSEQ3 0x ADC Channel Select Sequencing Control Register 3 ADCCHSELSEQ4 0x ADC Channel Select Sequencing Control Register 4 ADCASEQSR 0x ADC Auto sequence Status Register ADCRESULT0 0x ADC Conversion Result Buffer Register 0 ADCRESULT1 0x ADC Conversion Result Buffer Register 1 ADCRESULT2 0x00710A ADC Conversion Result Buffer Register 2 : : : : : : : : : : : : : : : : : : ADCRESULT14 0x ADC Conversion Result Buffer Register 14 ADCRESULT15 0x ADC Conversion Result Buffer Register 15 ADCTRL3 0x ADC Control Register 3 ADCST 0x ADC Status and Flag Register Register Address Description

6 - 7 ADC Control Register 1 - Upper Byte 0x reserved SUSMOD0 Emulation Suspend Mode 00 = [Mode 0] free run (do not stop) 01 = [Mode 1] stop after current sequence 10 = [Mode 2] stop after current conversion 11 = [Mode 3] stop immediately 11 ADC Module Reset 0 = no effect 0 = no effect 1 = reset (set back to 0 1 = reset (set back to 0 by ADC logic) by ADC logic) SUSMOD1 RESET ACQ_PS3 ACQ_PS2ACQ_PS1ACQ_PS0 Acquisition Time Prescale (S/H) Value = (binary+1) * Time dependent on the “Conversion Clock Prescale” bit (Bit 7 “CPS”) Clock Prescale” bit (Bit 7 “CPS”)

6 - 8 ADC Control Register 1 - Lower Byte 0x CPS CONT_RUN reserved Sequencer Mode 0 = dual mode 1 = cascaded mode 3 Continuous Run 0 = stops after reaching end of sequence end of sequence 1 = continuous (starts all over again from “initial state”) again from “initial state”) Conversion Prescale 0 = CLK / 1 1 = CLK / 2 SEQ_CASC reserved SEQ1_OVRD Sequencer Override (continuous run mode) 0 = sequencer pointer resets to “initial state” at end of MAX_CONVn at end of MAX_CONVn 1 = sequencer pointer resets to “initial state” after “end state” after “end state”

6 - 9 ADC Control Register 2 - Upper Byte 0x EVB_SOC_SEQ RST_SEQ1 Interrupt Enable (SEQ1) 0 = interrupt disable 1 = interrupt enable EVB SOC (cascaded mode only) 0 = no action 1 = start by EVB signal signal 11 Reset SEQ1 0 = no action 0 = no action 1 = immediate reset 1 = immediate reset SEQ1 to “initial state” SEQ1 to “initial state” Start Conversion (SEQ1) 0 = clear pending SOC trigger 1 = software trigger-start SEQ1 EVA SOC SEQ1 Mask Bit 0 = cannot be started by EVA trigger by EVA trigger 1 = can be started by EVA trigger by EVA trigger INT_ENA_SEQ1 INT_MOD_SEQ1 reserved EVA_SOC_SEQ1 SOC_SEQ1 Interrupt Mode (SEQ1) 0 = interrupt every EOS 1 = interrupt every other EOS

ADC Control Register 2 - Lower Byte 0x EXT_SOC_SEQ1 RST_SEQ2 External SOC (SEQ1) 0 = no action 1 = start by signal from ADCSOC pin from ADCSOC pin 3 Reset SEQ2 0 = no action 0 = no action 1 = immediate reset 1 = immediate reset SEQ2 to “initial state” SEQ2 to “initial state” Start Conversion (SEQ2) (dual-sequencer mode only) 0 = clear pending SOC trigger 1 = software trigger-start SEQ2 EVB SOC SEQ2 Mask bit 0 = cannot be started by EVB trigger by EVB trigger 1 = can be started by EVB trigger by EVB trigger INT_ENA_SEQ2INT_MOD_SEQ2 reserved EVB_SOC_SEQ2 SOC_SEQ2 Interrupt Enable (SEQ2) 0 = interrupt disable 1 = interrupt enable Interrupt Mode (SEQ2) 0 = interrupt every EOS 1 = interrupt every other EOS

ADC Control Register 3 0x Sampling Mode Select 0 = sequential sampling mode 1 = simultaneous sampling mode ADC Clock Prescale ADCCLKPS3 ADCCLKPS2 ADCCLKPS1 ADCCLKPS0 SMODE_SEL ADCRFDN ADCBGND ADCPWDN reserved ADC Reference Power Down 0 = powered down 1 = powered up ADC Bandgap Power Down 0 = powered down 1 = powered up ADC Power Down (except Bandgap & Ref.) 0 = powered down 1 = powered up

Maximum Conversion Channels Register 0x MAX_ CONV 2_2 MAX_ CONV 2_1 MAX_ CONV 2_0 MAX_ CONV 1_3 MAX_ CONV 1_2 MAX_ CONV 1_1 MAX_ CONV 1_0 reserved Cascaded Mode Dual Mode SEQ2SEQ1  Bit fields define the maximum number of auto conversions (binary+1)  Auto conversion session always starts with the “initial state” and continues sequentially until the “end state”, if allowed and continues sequentially until the “end state”, if allowed SEQ1 SEQ2 Cascaded SEQ1 SEQ2 Cascaded Initial state CONV00 CONV08 CONV00 End state CONV07 CONV15 CONV15

ADC Input Channel Select Sequencing Control Register Bits Bits 11-8 Bits 7-4 Bits 3-0 Bits Bits 11-8 Bits 7-4 Bits 3-0 0x CONV03 CONV02 CONV01 CONV00 ADCCHSELSEQ1 0x CONV07 CONV06 CONV05 CONV04 ADCCHSELSEQ2 0x CONV11 CONV10 CONV09 CONV08 ADCCHSELSEQ3 0x CONV15 CONV14 CONV13 CONV12 ADCCHSELSEQ4

Example - Sequencer “Start/Stop” Operation I 1, I 2, I 3 V 1, V 2, V 3 I 1, I 2, I 3 V 1, V 2, V 3 EVA Timer 1 EVAPWM System Requirements: Three auto conversions (I 1, I 2, I 3 ) off trigger 1 (Timer underflow)Three auto conversions (I 1, I 2, I 3 ) off trigger 1 (Timer underflow) Three auto conversions (V 1, V 2, V 3 ) off trigger 2 (Timer period)Three auto conversions (V 1, V 2, V 3 ) off trigger 2 (Timer period) Event Manager A (EVA) and SEQ1 are used for this example with sequential sampling mode

Example - Sequencer “Start/Stop” Operation (Continued) Bits  Bits  x V 1 I 3 I 2 I 1 ADCCHSELSEQ1 0x x x V 3 V 2 ADCCHSELSEQ2 MAX_CONV1 is set to 2 and Channel Select Sequencing Control Registers are set to: MAX_CONV1 is set to 2 and Channel Select Sequencing Control Registers are set to: Once reset and initialized, SEQ1 waits for a trigger Once reset and initialized, SEQ1 waits for a trigger First trigger three conversions performed: CONV00 (I 1 ), CONV01 (I 2 ), CONV02 (I 3 ) First trigger three conversions performed: CONV00 (I 1 ), CONV01 (I 2 ), CONV02 (I 3 ) MAX_CONV1 value is reset to 2 (unless changed by software) MAX_CONV1 value is reset to 2 (unless changed by software) SEQ1 waits for second trigger SEQ1 waits for second trigger Second trigger three conversions performed: CONV03 (V 1 ), CONV04 (V 2 ), CONV05 (V 3 ) Second trigger three conversions performed: CONV03 (V 1 ), CONV04 (V 2 ), CONV05 (V 3 ) End of second auto conversion session, ADC Results registers have the following values: End of second auto conversion session, ADC Results registers have the following values: RESULT0 I 1 RESULT3 V 1 RESULT1 I 2 RESULT4 V 2 RESULT2 I 3 RESULT5 V 3  User can reset SEQ1 by software to state CONV00 and repeat same trigger 1, 2 session SEQ1 keeps “waiting” at current state for another triggerSEQ1 keeps “waiting” at current state for another trigger

ADC Conversion Result Buffer Register 0x through 0x (Total of 16 Registers) With analog input 0V to 3V, we have: analog voltsconverted valueRESULTx 3.0FFFh1111|1111|1111| FFh0111|1111|1111| h0000|0000|0001| h0000|0000|0000|0000 MSB LSB

How do we Read the Result? Integer format RESULTx ACC Data Mem bit shift right xxxxxxxxxx xxxxxxxxxx0000 xxxxxxxxxx xx xx xx Example: read RESULT0 register #include "DSP281x_Device.h" void main(void) { Uint16 value;// unsigned Uint16 value;// unsigned value = AdcRegs.ADCRESULT0 >> 4; value = AdcRegs.ADCRESULT0 >> 4;} #include "DSP281x_Device.h" void main(void) { Uint16 value;// unsigned Uint16 value;// unsigned value = AdcRegs.ADCRESULT0 >> 4; value = AdcRegs.ADCRESULT0 >> 4;}

Lab 6: Two Channel Analogue Conversion initiated by GP Timer 1 AIM :  AD-Conversion of ADCIN_A0 and ADCIN_B0 initiated by GPT1-period of 0.1 sec.  ADCIN_A0 and ADCIN_B0 are connected to two potentiometers to control analogue input voltages between 0 and 3,0V.  no GPT1-interrupt-service  Auto-start of ADC with T1TOADC-bit !!  Use ADC-Interrupt Service Routine to read out the ADC results  Use main loop to show alternately the two results as light- beam on LED’s (GPIO port B7..B0)

Additional Registers to initialize Lab 6: General Purpose Timer Control ::GPTCONA Timer 1 Control:T1CON Timer 1 Period: T1PR Timer 1 Compare:T1CMPR Timer 1 Counter:T1CNT Interrupt Flag:IFR Interrupt Enable ask:IER ADC – Control 3:ADCTRL3 ADC – Control 2:ADCTRL2 ADC – Control 1:ADCTRL1 Channel Select Sequencer1:CHSELSEQ1 Max. number of conversions:MAXCONV ADC - Result 0:ADCRESULT0 ADC - Result 1:ADCRESULT1

Optional Lab6A Modify Lab-Exercise 4 ( ‘Knight-Rider’) : use the Analogue Input ADCIN0 to change use the Analogue Input ADCIN0 to change the frequency for the LED’s the frequency for the LED’s to add the ADC-setup use Lab6 as a start to add the ADC-setup use Lab6 as a start use a LED-frequency range between 50Hz and 1 Hz use a LED-frequency range between 50Hz and 1 Hz use (1) a linear or (2) a logarithm scale use (1) a linear or (2) a logarithm scale between F min and F max. between F min and F max.