1 ATD10B8CV2 on MC9SI2C By: Yuchun Huang. 2 ADC ADC Power Supply.

Slides:



Advertisements
Similar presentations
Jordan Barry Victor Brzeski
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.
FPGA Configuration. Introduction What is configuration? – Process for loading data into the FPGA Configuration Data Source Configuration Data Source FPGA.
MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
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.
SCI: Serial Communications Interface Presented by: Sean Kline Chad Smith Jamie Cruce.
Analog to Digital Conversion
Analog to Digital Converters Byron Johns Danny Carpenter Stephanie Pohl Harry “Bo” Marr October 4, 2005.
ECE 265 – LECTURE 14 Analog Signal Acquisition The A/D converters 5/14/ ECE265.
Chapter 11 Analog I/O Interfacing From Introduction to Embedded Systems by Valvano.
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.
68HC11 Analog I/O Chapter 12.
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)
ADC STUDENT LECTURE Andrew Brown Jonathan Warner Laura Strickland.
Introduction to Interrupts
H. Huang Transparency No.11-1 The 68HC11 Microcontroller Chapter 11: 68HC11 Analog to Digital Converter The 68HC11 Microcontroller Han-Way Huang Minnesota.
8-Bit Timer/Counter 0 Counter/Timer 0 and 2 (TCNT0, TCNT2) are nearly identical. Differences: -TCNT0 can run off an external 32Khz clock (Tosc) or the.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
1.  8051 Timers “count up,” incrementing the Timer’s respective “count register” each time there is a triggering clock pulse. 2  When the “count register”
Week #7 Data Acquisition System, Part (A)
System Clocks.
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.
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.
ELN5622 Embedded Systems Class 7 Spring, 2003 Aaron Itskovich
ELE2MIC Lecture 21 The AVR Sleep Modes ATMEGA128’s Analog to Digital Converter –Features –Block Diagram –Clock Source –Input Sources –Interrupts –BandGap.
1-1 Embedded Network Interface (ENI) API Concepts Shared RAM vs. FIFO modes ENI API’s.
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
Revised: Aug 1, ECE 263 Embedded System Design Lessons HC12 Analog-to-Digital (ATD) Converter System.
ME 4447/6405 Interrupts and Resets Suzanne Price Scott Gilliliand Greg Graf.
Micro-Research Finland Oy Timing System Modules Jukka Pietarinen EPICS Collaboration Meeting, Argonne, June 2006.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an overview of the CPU architecture.
8279 KEYBOARD AND DISPLAY INTERFACING
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.
1 ARM University Program Copyright © ARM Ltd 2013 Using Direct Memory Access to Improve Performance.
Conclusion Speech. Content Organization Pronunciation Handwriting.
7 - 1 Texas Instruments Incorporated Module 7 : Serial Peripheral Interface C28x 32-Bit-Digital Signal Controller TMS320F2812.
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
Interrupts  An interrupt is any service request that causes the CPU to stop its current execution stream and to execute an instruction stream that services.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the serial communication.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose This course provides an introduction to the peripheral functions.
8279 KEYBOARD AND DISPLAY INTERFACING
Data Acquisition System
Analog to Digital Converter (ADC)
ECE 447: Lecture 2 Internal Input/Output Devices A/D Converter.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
H. Huang Transparency No.10-1 The 68HC12 Microcontroller Chapter 10 68HC12 Analog to Digital Converter.
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.
Why are Timer Functions Important?
Chapter 12: Analog-to-Digital Converter
Analog Comparator An analog comparator is available on pins PE2(AIN0), PE3(AIN1) The comparator operates like any other comparator. -when (+) exceeds (-)
Analog-to-Digital Converter
Interrupts In 8085 and 8086.
RX Compare Match Timer (CMT)
RX 8-Bit Timer (TMR) 4/20/2011 Rev. 1.00
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
MSP432™ MCUs Training Part 6: Analog Peripherals
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).
Presentation transcript:

1 ATD10B8CV2 on MC9SI2C By: Yuchun Huang

2 ADC ADC Power Supply

3

4 ATD10B8CV2 Features Resolution: 8/10-bit Conversion Time: 7 µ sec for 10-bit Successive Approximation ADC 8-channel analog/digital input multiplexer Multiplexer: A device that can send several signals over a single line. External Trigger Control (Sync. ADC with external events) New Features of ATD10B8CV2 Conversion Complete Interrupt Left/right justified, signed/unsigned result Programmable Sample time & resolution selection

5 Operations Setting up and Starting the A/D Conversion Aborting the A/D Conversion Resets Interrupts ATD10B8CV2 Modes & Operations Modes Stop Mode All clocks halt; conversion aborts; minimum recovery delay Wait Mode Reduced MCU power; can resume Freeze Mode Breakpoint for debugging an application

6 ATD10B8CV2 Conversion Process & Time Power on Wait 20 μs for ATD power to stabilize Start Sampling Successive Approximation End Conversion time 8-bit: ATD Clock Cycles 10-bit: ATD Clock Cycles

7 ATD10B8CV2 Registers & Memory Map Number of Control Register is 6: 0x0000~0x0005 ATDCTL2 0x0080+0x0002 Power down; external trigger; interrupts ATDCTL3 0x0080+0x0003 Conversion Sequence Length; FIFO for result register; behavior in Freeze mode ATDCTL4 0x0080+0x0004 Resolution; conversion clock freq.; sample time ATDCTL5 0x0080+0x0005 Type of conversion sequence; analog input channel selection

8 ATD10B8CV2 Registers&Memory Map Number of Status Register is 2: 0x0006 / 0x000B ATDSTAT0 0x0080+0x0006 Power down; external trigger; interrupts ATDSTAT1 0x0080+0x000B Conversion Sequence Length; FIFO for result register; behavior in Freeze mode Number of Special/Test Register is 1: 0x0009 ATDTEST1 0x0080+0x0009 Power down; external trigger; interrupts Number of Conversion Result Registers is 16: 0x0010~0x001F ATDDR0H~ATDDR7L: 0x0080+0x0010~0x001F Power down; external trigger; interrupts

9 ATD10B8CV2 Registers & Memory Map Digital Input Enable Register # is 1: 0x000D ATDDIEN 0x0080+0x000D Power down; external trigger; interrupts ATDSTAT1 0x0080+0x000B Conversion Sequence Length; FIFO for result register; behavior in Freeze mode Digital Port Data Register # is 1: 0x000F PORTAD 0x0080+0x000F Power down; external trigger; interrupts Total # registers in ATD is 32: 0x0000~0x001F Including unimplemented or reserved ones:

10 ATD10B8CV2 - Control Registers ATDCTL2 $0082A/D power down; external trigger; interrupt PINDescription 70-power down ATD; recovery time period 1-normal ATD functionality 60-normal clearing (read the CCF before reading the result register ) 1-Fast Flag Clearing (automatically clear CCF after any access to result register) 50-continue to run in Wait Mode; 1-Halt conversion and power down ATD during Wait Mode 40-External Trigger Edge 1-Trigger Level 30-Low /Falling trigger polarity 1-high/Rising trigger polarity 20-Disable external trigger mode 1-external trigger mode Enabled (Channel AN7) 10-ATD Sequence Complete Interrupt Request Disabled 1-ATD Sequence Complete Interrupt Request Enabled Abort the current A/D sequence Not start a new sequence Read-Only Flag of Complete Interrupt

11 4-Conversion Sequence Set MULT = 0 (for single channel) and SCAN = 0 (for consecutive) Channel ADR1 then Channel ADR2 then Channel ADR3 then Channel ADR4 Stop CONSECUTIVE Set MULT = 1 (for multiple channel) and SCAN = 1 (for continuous) Ch ADR1 then Ch+1 ADR2 then Ch+2 ADR3 then Ch+3 ADR4 Overwrite ADR’s CONTINUOUS

12 ATD10B8CV2 - Control Registers ATDCTL3 $0083Sequence Length; FIFO Result; Freeze Behavior PINDescription 6~3 # of conversions per sequence (Table 8-4, P233) [1~8] 2 0- A/D Conversion #1-  result register #1, …… (fixed) 1- current conversion-  conversion counter result register, sequentially, wrap around when reaching maximum register # *: starting a new conversion by writing to ATDCTL5 clear the conversion counter to Zero -  first conversion---always in first result register ATDDR0 1 Breakpoint Behavior (Freeze Mode) when debugging (Table 8-5, P233) [00:continue conversion;10:finish current conversion then freeze;11:freeze immediattly ] 0 Abort the current A/D sequence Not start a new sequence

13 ATD10B8CV2 - Control Registers ATDCTL4 $0084Resolution; Sample Time PINDescription 7 Resolution [0:10-bit; 1:8-bit ] 6~5 Second phase of Sample time (Table 8-8, P237) [00: 2 clock period; 01: 4 ; 10: 8; 11: 16] 4~0 A/D Clock Prescaler [PRS: 0 ~31] Abort the current A/D sequence Not start a new sequence

14 ATD10B8CV2 - Control Registers ATDCTL5 $0085Type of conversion; sampled channels PINDescription 7 0-Result Register Justification Mode : Left X---15 both signed and unsigned 1-Result Register Justification Mode : Right 0---X unsigned only 6 0- Unsigned data in result register 1- Signed data in result register [2 ’ s complement] 5 0- Single Conversion Mode; Only Once 1- Continuous Conversion Mode. Scanning 4 0- Sample Only one channel [Selected by CC~CA, # by S8C~S1C in ATDCTL3] 1- Sample across several channels [first by CC~CA, increase the subseq. Channel code] 2~0 Analog Channel Input Selection Code (Table 8-12, P239) [000: AN0; 001:AN1; …… ; 111:AN7 MULT=0: selected channel; MULT=1: first channel in sequence, then sequentially, auto-wrap] Abort the current A/D sequence Start a new sequence

15 Single Channel, 4-Conversion Sequence Set MULT = 0 (for single channel) and SCAN = 0 (for consecutive) Channel ADR1 then Channel ADR2 then Channel ADR3 then Channel ADR4 Stop Set MULT = 0 (for single channel) and SCAN = 1 (for continuous) Channel ADR1 then Channel ADR2 then Channel ADR3 then Channel ADR4 Overwrite ADR’s CONSECUTIVE CONTINUOUS

16 Multi Channel, 4-Conversion Sequence Set MULT = 1 (for multiple channel) and SCAN = 0 (for consecutive) Ch ADR1 then Ch+1 ADR2 then Ch+2 ADR3 then Ch+3 ADR4 Stop Set MULT = 1 (for multiple channel) and SCAN = 1 (for continuous) CONSECUTIVE Ch ADR1 then Ch+1 ADR2 then Ch+2 ADR3 then Ch+3 ADR4 Overwrite ADR’s CONTINUOUS

17 ATD10B8CV2 - Status Registers ATDSTAT0 $0086 Sequence Complete Flag; Overrun; Conversion Counter PINDescription 7 0- Conversion Sequence not completed; 1- Conversion Sequence completed. [SCAN=1 set after each completed seq.] 5 0- No external trigger overrun error has occurred; 1- external trigger overrun error has occurred [ETrigLE=0, additional active edge while a conversion sequence is in progress] 4 0- No overrun in results; 1- An overrun in results. [result registers written before its CCF is cleared. Old data lost before reading] 3~0 Conversion counter [*: The conversion counter points to the result register that will receive the result of the current conversion; *: FIFO=0, the conversion counter is initialized to zero at the begin and end of the conversion sequence; *: FIFO=1, the register counter is not initialized. The conversion counters wraps around when its maximum value is reached.] Read-only

18 ATD10B8CV2-Status Registers ATDSTAT1 $008BConversion Complete Flag PINDescription 7~0 0- conversion # x is not completed; 1- conversion # x is completed, results available. [set at the end of each conversion in a sequence] Read-only

19 ATD10B8CV2 -Result Registers ATDDRHx/ATDDRLx $0090~$009F8 result registers, read-only

20 ATD10B8CV2 -Test/Special Registers ATDCTL2 $0089Special Channel conversion PINDescription 0 0- special channel conversion disabled; 1- special channel conversion selected. [ Note: Always write remaining bits of ATDTEST1 (Bit7 to Bit1) zero when writing SC bit. Not doing so might result in unpredictable ATD behavior; *: special meaning for CC~CA in ATDCTL5 ]

21 ATD10B8CV2 - GPIO Registers ATDDIEN $008D Digital Input enabled flag from analog pin AN0~AN7 to PTADx registers PINDescription 7~0 0- disable digital input buffer from analog pin ANx to PTADx registers; 1- enable digital input buffer from analog pin ANx to PTADx registers. [ Note: If this bit is set while simultaneously using it as an analog port, there is potentially increased power consumption ]

22 ATD10B8CV2 - GPIO Registers PORTAD $008FGPIO port data registers PINDescription 7~0 If IENx=1, Read the logic level on ANx pin [ Note: signal potentials not meeting VIL or VIH specifications will have an indeterminate value ]

23 ATD10B8CV2 - Setting up and Starting Step 1: Power up the ATD and define settings in ATDCTL2 ADPU-  1 (power up) ; ASCIE=1 (enable interrupt) Step 2: Wait for the ATD recovery time before proceeding CPU loop Step 3: Configure number of conversion in a sequence S8C~S1C, FIFO in ATDCTL3 Step 4: Configure resolution, sampling time and ATD clock Speed SRES8; SMP1~0;PRS4~0 in ATDCTL4 Step 5: Configure Starting Channel, Single/Multiple Channel, SCAN and result data SIGNED? CC~CA, MULT, SCAN, DJM, DSGN in ATDCTL5

24 ATD10B8CV2 - Aborting the conversion Step 1: Disable the ATD Interrupt in ATDCTL2 ASCIE  0 (disable interrupt) Step 2: Clear SCF flag in ATDSTAT0 SCF-  1 Step 3: Power down ATD ADPU=0 in ATDCTL2

25 Using the ATD10B8C to Read Chan. AN1 ORG$1000 LDAA#$80;ADPU=1 STAAATDCTL2 Power on ATD Subsystem ATDCTL2EQU$0082 ATDCTL4EQU$0084 ATDCTL5EQU$0085 ATDDR1HEQU$0092 ATDSTAT1EQU$008B ORG$2000 ADRESULTRMB1 Delay for power to stabilize LDY#160;delay for 20  s DELAY DEY BNEDELAY LDAA#$01;SCAN=0,MULT=0,CC:CA=001 STAAATDCTL5;start conversion LDX#ATDSTAT1;check for complete flag BRCLR 0,X #$02 ;CCF1 is bit 1 LDAAATDDDR1H;read chan. 1 STAAADRESULT;store in result SWI Set ADCTL5 to start conversion Wait until conv. complete Read result LDAA#$85;SRES8=1, PRESCALER BITS = STAAATDCTL4 8-bit resolution, appropriate prescaler

26 ATD10B8CV2 - Interrupts

27 A/D Conversion with the ATD10B8C Chapter 8 in Reference Manual Pg in Reference Guide Where to look:

28 References Ron Bishop, “Basic Microprocessors and the 6800”, Hayden Book Company Inc., 1979 Motorola, “MC912SC Family Data Sheet”, Motorola, Inc., Rev. 5, Motorola, “MC912SC Reference Manual”, Motorola, Inc., Rev. 4, Motorola, “MC912SC Programming Reference Guide”, Motorola, Inc., Rev. 2, Wikipedia The book se/ se/