EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 11: Sampling, ADCs, a

0
0
1725 days ago, 672 views
PowerPoint PPT Presentation
2. Declarations. Homework, Labs, and Minute QuizzesOffice HoursTuesday, Oct 12, 2:30 PM

Presentation Transcript

Slide 1

EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 11: Sampling, ADCs, and DACs Oct 12, 2010 Slides adjusted from Jonathan Hui http://www.cs.berkeley.edu/~jwhui

Slide 2

Announcements Homework, Labs, and Minute Quizzes Office Hours Tuesday, Oct 12, 2:30 PM – 3:30 PM, in EECS 2334 Thursday, Oct 14, 1:30 PM – 3:00 PM, in CSE 4773 Last ones preceding the Midterm Thursday, Oct 21, 2010 10:40 AM – 11:30 AM ( 50 minutes) In-class Labs

Slide 3

Outline Minute test Announcements Sampling ADC DAC

Slide 4

We live in a simple world Everything in the physical world is a simple flag Sound, light, temperature, weight Need to change over into electrical signs Transducers: changes over one sort of vitality to another Electro-mechanical, Photonic, Electrical, … Examples Microphone/speaker Thermocouples Accelerometers

Slide 5

Transducers change over one type of vitality into another Transducers Allow us to change over physical marvels to a voltage potential in a very much characterized way.

Slide 6

Convert light to voltage with a CdS photocell V flag = (+5V) R/(R + R ) Choose R=R R at middle of planned range Cadmium Sulfide (CdS) Cheap, low current t RC = C l *(R+R R ) Typically R~50-200k W C~20pF So, t RC ~20-80uS f RC ~ 10-50kHz Source: Forrest Brewer

Slide 7

Force strain gages - thwart, conductive ink conductive elastic rheostatic liquids Piezorestive (needs connect) piezoelectric movies capacitive constrain Charge source Sound Microphones Both current and charge adaptations Sonar Usually Piezoelectric Position microswitches shaft encoders gyros Acceleration MEMS Pendulum Monitoring Battery-level voltage Motor current Stall/speed Temperature Voltage/Current Source Field Antenna Magnetic Hall impact Flux Gate Location Permittivity Dielectric Many other basic sensors (some advanced) Source: Forrest Brewer

Slide 8

Engineering Units Physical Phenomena Voltage or Current ADC Counts Sensor ADC Software Going from simple to computerized What we need How we need to arrive Physical Phenomena Engineering Units

Slide 9

Representing a simple flag carefully How would we speak to a simple flag? As a period arrangement of discrete qualities  On MCU: read the ADC information enlist occasionally V Counts

Slide 10

Range Too Big Range Too Small Ideal Range Choosing the level range What do the example values speak to? Some part inside the scope of qualities  What range to utilize?

Slide 11

Choosing the flat granularity Resolution Number of discrete qualities that speak to a scope of simple qualities MSP430: 12-bit ADC 4096 qualities Range/4096 = Step Larger extend  less data Quantization Error How distant discrete esteem is from genuine ½ LSB  Range/8192 Larger go  bigger blunder

Slide 12

Converting between voltages, ADC checks, and building units Converting: ADC tallies  Voltage Converting: Voltage  Engineering Units

Slide 13

A note about inspecting and math Converting values in 16-bit MCUs vtemp = adccount/4095 * 1.5; tempc = (vtemp-0.986)/0.00355;  tempc = 0 Fixed guide operations Need toward stress over sub-current and flood Floating point operations They can be expensive on the hub

Slide 14

Choosing the example rate What test rate do we require? Too little: we can't recreate the flag we think about Too much: squander calculation, vitality, assets Example: 2-bytes per test, 4 kHz  8 kB/second What about examining jitter? Keep in mind Lab 1?

Slide 15

Shannon-Nyquist examining hypothesis If a consistent time flag contains no frequencies higher than , it can be totally controlled by discrete specimens taken at a rate: Example: Humans can prepare sound signs 20 Hz – 20 KHz Audio CDs: tested at 44.1 KHz

Slide 16

Use hostile to associating channels on ADC contributions to guarantee that Shannon-Nyquist is fulfilled Aliasing Different frequencies are indistinct when they are inspected. Condition the info flag utilizing a low-pass channel Removes high-recurrence parts (a.k.a. hostile to associating channel)

Slide 17

Designing the counter associating channel Note w is in radians w = 2 p f Exercise: Find a R+C match so that the half-control point happens at 30 Hz

Slide 18

Direct Samples Dithered Samples Can utilize dithering to manage quantization Dithering Quantization mistakes can bring about expansive scale designs that don't precisely depict the simple flag Introduce arbitrary (white) commotion to randomize the quantization blunder.

Slide 19

Outline Minute test Announcements Sampling ADC DAC

Slide 20

The nuts and bolts of Analog-to-Digital Conversion So, how would you change over simple signs to a discrete qualities? A product see: Set some control registers : Specify where the information is originating from (which stick) Specify the range (min and max) Specify qualities of the info flag (settling time) Enable hinder and set a bit to begin a change When hinder happens, read test from information enroll Wait for an example period Repeat step 1

Slide 21

Architecture of the TI MSP430 ADC subsystem

Slide 22

ADC Features

Slide 23

ADC Core Input Analog flag Output 12-bit advanced estimation of information in respect to voltage references Linear transformation

Slide 24

SAR ADC SAR = Successive-Approximation-Register Binary pursuit to discover nearest computerized esteem Conversion time log(bits)

Slide 25

SAR ADC SAR = Successive-Approximation-Register Binary inquiry to discover nearest advanced esteem 1 Sample  Multiple cycles

Slide 26

SAR ADC 1 Sample  Multiple cycles

Slide 27

Timing driven by: TimerA TimerB Manually utilizing ADC12SC bit Signal choice utilizing SHSx Polarity choice utilizing ISSH Sample and Conversion Timing

Slide 28

Voltage Reference Voltage Reference Generator 1.5V or 2.5V REFON bit in ADCCTL0 Consumes vitality when on 17ms settling time External references permit subjective reference voltage Exercise: If you need to test Vcc, what Vref would it be a good idea for you to utilize?

Slide 29

Sample Timing Considerations Port 6 inputs default to high impedance When test begins, information is empowered But capacitance causes a low-pass channel impact  Must sit tight for the information flag to merge

Slide 30

How it looks in code: ADC12CTL0 = SHT0_2 | REF1_5V | REFON | ADC12ON; ADC12CTL1 = SHP; Software Configuration

Slide 31

12 conceivable data sources 8 outer pins (Port 6) 1 Vref+ (outside) 1 Vref-(outer) 1 Thermistor 1 Voltage supply External pins may work as Digital I/O or ADC. P6SEL enroll Inputs and Multiplexer

Slide 32

16 test cushion Each cradle arranges test parameters Voltage reference Input channel End-of-grouping CSTARTADDx demonstrates where to compose next specimen Conversion Memory

Slide 33

Single-Channel Single-Conversion Single channel inspected and changed over once Must set ENC (Enable Conversion) bit each time Sequence-of-Channels Sequence of channels examined and changed over once Stops when achieving ADC12MCTLx with EOS bit Repeat-Single-Channel Single channel inspected and changed over persistently New example happens with each trigger (ADC12SC, TimerA, TimerB) Repeat-Sequence-of-Channels Sequence of channels examined and changed over more than once Sequence re-begins when achieving ADC12MCTLx with EOS bit Conversion Modes

Slide 34

How it looks in code: Configuration ADC12CTL0 = SHT0_2 | REF1_5V | REFON | ADC12ON; ADC12CTL1 = SHP; ADC12MCTL0 = EOS | SREF_1 | INCH_11; Reading ADC information m_reading = ADC12MEM0; Software Configuration

Slide 35

A Software Perspective summon void Read.read() { ADC12CTL0 = SHT0_2 | REF1_5V | REFON | ADC12ON; ADC12CTL1 = SHP; ADC12MCTL0 = EOS | SREF_1 | INCH_11; call Timer.startOneShot( 17 ); } occasion void Timer.fired() { ADC12CTL0 |= ENC; ADC12IE = 1; ADC12CTL0 |= ADC12SC; } assignment void signalReadDone() { signal Read.readDone( SUCCESS, m_reading ); } async occasion void HplSignalAdc12.fired() { ADC12CTL0 &= ~ENC; ADC12CTL0 = 0; ADC12IE = 0; ADC12IFG = 0; m_reading = ADC12MEM0; post signalReadDone(); }

Slide 36

A Software Perspective charge void Read.read() { ADC12CTL0 = SHT0_2 | REF1_5V | REFON | ADC12ON; ADC12CTL1 = SHP; ADC12MCTL0 = EOS | SREF_1 | INCH_11; call Timer.startOneShot( 17 ); } occasion void Timer.fired() { ADC12CTL0 |= ENC; ADC12IE = 1; ADC12CTL0 |= ADC12SC; } undertaking void signalReadDone() { signal Read.readDone( SUCCESS, m_reading ); } async occasion void HplSignalAdc12.fired() { ADC12CTL0 &= ~ENC; ADC12CTL0 = 0; ADC12IE = 0; ADC12IFG = 0; m_reading = ADC12MEM0; post signalReadDone(); }

Slide 37

A Software Perspective order void Read.read() { ADC12CTL0 = SHT0_2 | REF1_5V | REFON | ADC12ON; ADC12CTL1 = SHP; ADC12MCTL0 = EOS | SREF_1 | INCH_11; call Timer.startOneShot( 17 ); } occasion void Timer.fired() { ADC12CTL0 |= ENC; ADC12IE = 1; ADC12CTL0 |= ADC12SC; } errand void signalReadDone() { signal Read.readDone( SUCCESS, m_reading ); } async occasion void HplSignalAdc12.fired() { ADC12CTL0 &= ~ENC; ADC12CTL0 = 0; ADC12IE = 0; ADC12IFG = 0; m_reading = ADC12MEM0; post signalReadDone(); }

Slide 38

A Software Perspective summon void Read.read() { ADC12CTL0 = SHT0_2 | REF1_5V | REFON | ADC12ON; ADC12CTL1 = SHP; ADC12MCTL0 = EOS | SREF_1 | INCH_11; call Timer.startOneShot( 17 ); } occasion void Timer.fired() { ADC12CTL0 |= ENC; ADC12IE = 1; ADC12CTL0 |= ADC12SC; } assignment void signalReadDone() { signal Read.readDone( SUCCESS, m_reading ); } async occasion void HplSignalAdc12.fired() { ADC12CTL0 &= ~ENC; ADC12CTL0 = 0; ADC12IE = 0; ADC12IFG = 0; m_reading = ADC12MEM0; post signalReadDone(); }

Slide 39

A Software Perspective summon void Read.read() { ADC12CTL0 = SHT0_2 | REF1_5V | REFON | ADC12ON; ADC12CTL1 = SHP; ADC12MCTL0 = EOS | SREF_1 | INCH_11; call Timer.startOneShot( 17 ); } occasion void Timer.fired() { ADC12CTL0 |= ENC; ADC12IE = 1; ADC12CTL0 |= ADC12SC; } assignment void signalReadDone() { signal Read.read

SPONSORS