Sunteți pe pagina 1din 21

Controlling and Accessing

Hardware I

Sensors, signal conditioning, Digital I/O, A/D-D/A


conversion, sampling rates

MSP430 ADC
Embedded System Hardware
„ Embedded system hardware is frequently used
in a loop -“hardware in a loop“:

Examples of other loops: Heating, Lights, Engine control,


Power supply, …, Robots

© P. Marwedel, Univ. Dortmund, Informatik 12, 2006/7, Embedded System Design


Sensors
„ Processing of physical data starts with capturing sensor data.
„ Sensors - virtually every physical and chemical quantity
(weight, velocity, acceleration, electrical current, voltage,
temperatures etc., chemical compounds)
„ Huge amount of sensors designed in recent years
PROPERTY SENSOR ACTIVE/PASSIVE OUTPUT
Temperature Thermocouple Passive Voltage
Silicon Active Voltage/Current
RTD Active Resistance
Thermister Active Resistance
Force/Pressure Strain Gage Active Resistance
Piezoelectric Passive Voltage
Acceleration Accelerometer Active Capacitance
Position LVDT Active AC Voltage
Light Intensity Photodiode Passive Current

RTD (resistance-temperature detector) Passive: self-generating


LVDT (linear variable displacement transducer) Active: Requires external excitation
© Wilson, JS (2005), Sensor Technology Handbook.
Analog-to-Digital Conversion
„ Digitization: creating a digital representation of an
analog quantity (Computers speak 1’s and 0’s)
„ aka “A2D”, “A/D”, “ATOD”, “ADC”
„ Several types of ADCs – provide different speeds with
varying levels of complexity
„ Resolution – how many bits over the input analog
range?

Westcott, T. Sampling: What Nyquist Didn't Say, and What to Do About It. Wescott Design Services
Flash A2D Converter
„ Easiest to understand
„ Parallel comparison with reference voltage
„ Very very fast - video processing
„ Often lower resolution (here is 4 bits of resolution)

© P. Marwedel, Univ. Dortmund, Informatik 12, 2006/7, Embedded System Design


Successive Approximation
„ Uses binary search starting with MSB
„ Set MSB='1‘ - if too large: reset MSB
„ Set MSB-1='1‘ - if too large: reset MSB-1, etc.
„ Slower, but can be very precise

© P. Marwedel, Univ. Dortmund, Informatik 12, 2006/7, Embedded System Design


Successive Approximation

1100
1011
Vx 1010
1000

V-

t
© P. Marwedel, Univ. Dortmund, Informatik 12, 2006/7, Embedded System Design
Application areas for ADCs
ENOB - Effective number of bits at bandwidth

(used in multimeters)
(using single bit D/A-converters;
common for high quality audio equipments)
[http://www.beis.de/Elektronik/
DeltaSigma/DeltaSigma.html]

(Pipelined flash
converters)

[Gielen et al., DAC 2003]


Reconstruction

Westcott, T. Sampling: What Nyquist Didn't Say, and What to Do About It. Wescott Design Services
Quantization Noise
„ N = (approximated - real signal) called quantization noise.
Example: quantization noise for sine wave

© P. Marwedel, Univ. Dortmund, Informatik 12, 2006/7, Embedded System Design


Discretization of time
„ Restriction in digital information processing;
Known digital computers can only process
discrete time series.
„ Discrete time; sample and hold-devices.
„ Ideally: width of clock pulse -> 0
Sampling Frequency & Nyquist
„ Digitizing loses information – must sample at a rate high
enough so that critical information not lost.
„ Nyquist = sample at 2x the highest frequency you want
to recover (only works perfectly in reconstructing sin
waves!)

Westcott, T. Sampling: What Nyquist Didn't Say, and What to Do About It. Wescott Design Services
Signal Conditioning
„ Sensor outputs are generally small, and require “signal
conditioning”
„ amplification – increase signal amplitude
„ level shifting – changing DC offset, signal/dual supply
„ galvanic isolation – preventing flow of ions (electrons), using
different method to exchange information – safety. Decoupling.
„ Transformer – magnetic flux
„ Opto-isolators - light
„ impedance transform – preparing signal for A/D
„ linearization – sensors are often nonlinear, like thermisters
„ filtering – removing noise or motion artifact, smoothing, etc.
Sensor Ranges
„ Resistance are most common
Sensor Type Resistance Range [Ohms Ω]
Stain gages 120, 350, 3500
Weigh-Scale Load Cells 350 - 3500
Pressure Sensors 350 - 3500
Relative Humidity 100k - 10M
Resistance Temperature Devices (RTDs) 100, 1000
Thermisters 100 - 10M

„ Converting Resistance to Voltage


Vout = I(R + R) Vin

I R
R
Vout = Vin *
R+ R R+ R
R+ R
Wheatstone Bridge
„ If bridge balanced, Vout = 0;
„ If one leg is a sensor, Vout != 0;
Typical Circuit
MSP430 2013 Sigma-Delta
„ More complicated to understand
„ Estimating the signal, computing and minimizing error

„ 16-bit resolution
Configuring modulator
frequency
Reference Voltage

fM = Modulator
Frequency

Analog
Inputs Configure sampling
(once, continuous)
Programmable and start sampling
Gain Amplifier

Register containing
conversion result

Converter Configuring format


of output result
Converter Configurations
„ Conversion Modes
„ Single vs Continuous (SD16SNGL = 1 or 0)
„ Start/Stop Conversions
Data Output Format
„ Using SD16UNI and SD16DF to configure one of
these three modes
„ Depends on input signal range
Temperature Program
„ Using the Integrated Temperature Sensor as analog
input
„ msp430x20x3_sd16A_02.c - review
„ msp430x20x3.h – look for #defines
„ Overview
„ Watchdog used as interval timer (7.2.3)
„ LED used as output digital signal
„ Integrated temperature sensor used as analog input
„ Enters low power mode after enabling interrupts
„ When temperature doesn’t change much, leave LED OFF
„ If temperature changes ~ 0.5°C, turn LED ON

S-ar putea să vă placă și