You are on page 1of 24

EMBEDDED SYSTEMS ENGINEERING

LECTURE 07 (ADC)

Nushara Wedasingha
Mphil(AI) Candidate, Bsc.(Hons) EEE
Department of Electrical and Computer
Engineering
Faculty of Engineering
Sri Lanka Institute of Information Technology
WHAT ARE ANALOG AND
DIGITAL SIGNALS?
Analog Signals Digital Signals

• A continous signal. • Discrete signal having only a few levels.


• Highly susceptible to noise. • Easy to process and store.
• Noise is added in signal generation, • Susceptible to noise when transmitted but
transmission, and storing. can be removed easily compared to analog.
• Noise is amplified when signal is amplified.
WHY ADC?
• Analysing physical signals.
• Easy to store and process data.
• A reversed transformation can recreate the original analog
signal back (with a minimal error)
• Digital equivalent can be transmitted with a little harm to the
quality and used as the analog version at the destination (this is
where D2A comes)
TYPES OF ADC’S
Pros and Cons
Type of ADC Applications
Pros Cons
Dual Ramp Highly Accurate Slow Multi-Meters
Flash Very Fast Resolution is limited to 8 bits Oscilloscopes, Micro Waves
Successive Approximation Moderate Speed Moderate Accuracy MSP430, PIC, ARM, Freescale

Dual Ramp ADC Flash ADC


CONCEPTS OF ADC
ADC

Analog Signal Digital Signal


1. Reference Voltage

2. Resolution

3. Sampling

4. Quantizing
REFERENCE VOLTAGE
1. Maximum expected for the analog input : - V REF+

2. Minimum expected for the analog input : - V REF-


VREF+ 5v to 3.3v

VREF- 0v

Special Note:
Analog signals beyond this range should be properly amplified and off-set before they are fed to A2D converter.
RESOLUTION
A measure of the fineness of conversion is called the resolution.

(𝑉 𝑅𝐸𝐹 +−𝑉𝑅 𝐸𝐹 −)
Γ=¿ 𝑛
2

– Resolution
VREF+ - Maximum Voltage
VREF- - Maximum Voltage
n – Bit Length of the ADC Register
SAMPLING
Input Signal

• Read the analog input periodically.


• Use the samples read and re-create the
signal later.
• The higher the sampling rate the better the
quality of the re-created signal.
Nyquist Theorem
Nyquist Theory: Sampled Signal

Fs

Fs- Sampling Rate


QUANTIZATION
Special Note:
• Quantization Error: The difference beteween the actual
and calculated sample.
• This error can appear as a noise when the signal is
reproduced by D2A conversion.

Γ
QE=±
q0 - 0…000 – 0v – Lowest Analog Value 2
q1 - 0…001
: : : : :::
: : : : ::: Γ − 𝑅𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛
qn - 1…111 – 5v or 3.3v – Highest Analog Value

n – Size of ADC Register


ELEMENTS OF AN A2D
MODULE
ELEMENTS IN AN ADC OF
MSP430FR5739
• Greater than 200-ksps maximum conversion rate

• Monotonic 10-bit converter with no missing codes

• Sample-and-hold with programmable sampling periods controlled by software or timers

• Conversion initiation by software or different timers

• Software-selectable on-chip reference using the REF module or external reference

• Twelve individually configurable external input channels

• Conversion channel for temperature sensor of the REF module

• Selectable conversion clock source

• Single-channel, repeat-single-channel, sequence, and repeat-sequence conversion modes

• Window comparator for low-power monitoring of input signals

• Interrupt vector register for fast decoding of six ADC interrupts (ADC10IFG0, ADC10TOVIFG, ADC10OVIFG,
ADC10LOIFG, ADC10INIFG, ADC10HIIFG)
ADC INSIDE A MSP430
ADC IN MSP430 FR
REGISTERS
ADC10CTL0
ADC10CTL1
ADC10CTL2
ADC10MEMO
ADCMCTL0
ADCIE
ADCIFG
ADC REGISTERS MSP430
EXAMPLE CODE
Starting ADC:
while(1):
ADC10CTL0|= ADC10SC;
while(ADC10CTL1 & ADCBUSY);
mem = ADC10MEM;
ADC CORE OF
MSP430FR5739
• The conversion formula for the ADC result NADC:

𝑁 𝐴𝐷𝐶 − 𝐷𝑖𝑔𝑖𝑡𝑎𝑙 𝑂𝑢𝑡𝑝𝑢𝑡


𝑉𝑖𝑛− 𝐼𝑛𝑝𝑢𝑡 𝑉𝑜𝑙𝑡𝑎𝑔𝑒 𝑜𝑓 𝑆𝑒𝑛𝑠𝑜𝑟
𝑉 𝑅+− 𝑀𝑎𝑥𝑖𝑚𝑢𝑚 𝑅𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒 𝑉𝑜𝑙𝑡𝑎𝑔𝑒
𝑉 𝑅 − − 𝑀𝑖𝑛𝑖𝑚𝑢𝑚 𝑅𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒𝑉𝑜𝑙𝑡𝑎𝑔𝑒
THANK
YOU

You might also like