Getting Precise With MSP430 Sigma-Delta ADC Peripherals: Vincent Chan MSP430 Business Development Manager TI Asia
Getting Precise With MSP430 Sigma-Delta ADC Peripherals: Vincent Chan MSP430 Business Development Manager TI Asia
Agenda
Sigma-Delta basics & benefits Understanding the SD16_A Choosing an MSP430 integrated ADC Lab exercise: Hands-on with the SD16_A
Sigma-Delta Basics
AMPLITUDE
+
TIME
1 0
1-bit DAC
Simple analog: 1-bit ADC Integration () & difference () stages Complex digital: filter stage Over sampled input Decimation filtered output
2005 Texas Instruments Inc, Slide 3
SD16 Overview
F42x & FE42x Multiple channels Single external input per channel Up to 256 OSR 1MHz fM
Ax.0 Ax.1 Ax.2 Ax.3 Ax.4 Ax.5 Ax.6 Ax.7 + + + + + + + + Temperature sensor
Reference
fM
VREF
1.2V
0 1 1 0 1
Divider
Channel x
PGA
SD16MEMx
SD16PREx
SD16_A Overview
F42x0 & F20x3 Single channel Multiple input pairs Input buffer AVCC measure 30kHz to 1.1MHz fM divider Up to 1024 OSR
A0 A1 A2 A3 A4 A5 A6 A7 + + + + + + + + Start Conversion Logic VREF 1.2V Reference fM Divider Divider 0 1 1 0 1
BUF
PGA
SD16MEM0
Temp. sensor
A5
Conversion Modes
Single conversion
Conversion SD16SC Set in SW Auto-clear
Continuous conversion
Conversion SD16SC Set in SW Conversion Conversion Conv
Cleared in SW
Clearing SD16SC immediately stops conversion: The value in SD16MEMx can change and should be read prior to halting conversion
2005 Texas Instruments Inc, Slide 7
A0 A1 A2 A3 A4 A5 A6 A7
+ + + + + + + + -
BUF
PGA
Selectable current vs. speed input buffer PGA: 1, 2, 4, 8, 16 & 32x SD16AEx bits for internal AIN- connection to AVSS
* Buffer not in F20x3 devices
Temp. sensor
A5
GAIN 1
+0.6V +0.5V
32
V ref GAIN
/ 2
PGA
0V
+0.015V -0.015V
-0.5V -0.6V
2005 Texas Instruments Inc, Slide 9
Channels are independent & can operate in parallel Inputs are multiplexed into each channel & must be selected/sampled sequentially
32 SD16PRE1 = 0 Conversion
Start of Conversion
1 Sample Ch1
st
Asynchronous Step
4.
0.8
0.6
2.
0.2
1.
Conversion
2005 Texas Instruments Inc, Slide 12
Internal Reference
SD16REFON VREF 0 1 Internal External SD16VMIDON Reference 1.2V AVSS AVCC VREF 0 1 Internal Only SD16VMIDON Reference SD16REFON 1.2V AVSS AVCC
SD16VMIDON = 0
SD16VMIDON = 1
CVREF = 470nF Ref buffer = +100x faster reference settling Disable once settled
2005 Texas Instruments Inc, Slide 14
ACLK = 32.768kHz, 256 OSR, SD16INTDLY_0 ~7.8ms/conversion ~950uA: CPU in LPM3 (~1009uA: CPU in LPM0) SMCLK = 1.048MHz, 256 OSR, SD16INTDLY_0 ~244us/conversion ~1095uA: CPU in LPM0 ~32x Faster Conversion @ ~15% Greater Current
2005 Texas Instruments Inc, Slide 15
Source SD16IV Contents No interrupt pending 0 SD16MEMx overflow 02h SD16CCTL0 IFG 04h Reserved 06h Reserved 08h Reserved 0Ah Reserved 0Ch Reserved 0Eh Reserved 10h
One shared interrupt vector: SD16_A IFG & overflow Fast decoding reduces code size/CPU load
2005 Texas Instruments Inc, Slide 16
; Handle channel 1 interrupt ; Handle channel 1 interrupt ; Handle overflow interrupt ; Handle overflow interrupt
Using __even_in_range()
versus
Voltage range to be measured? Max frequency for AIN? How much resolution? Differential inputs? Reference range? Multiple channels?
Sigma-Delta
Slope
Add appropriate SD16_A configuration code Configure for single conversion from A7 Start conversion & poll IFG Reconfigure for single conversions from A1
2005 Texas Instruments Inc, Slide 23
Get conversion and subtract measured offset Turn off internal reference
2005 Texas Instruments Inc, Slide 25
ai r
pr
es su
re
Init Configure Peripherals Measure Offset Single sample A7+/Reconfigure for A0+/(continuous) Main Enter LPM0 Calculate Pressure Update Display
Add appropriate SD16_A configuration code Configure for single conversion from A7 Start conversion & poll IFG Reconfigure for continuous conversions from A0
2005 Texas Instruments Inc, Slide 28
Make sure external reference has settled before offset measurement is made!