s8 Processeurs MSP 432 Adc & Dac
s8 Processeurs MSP 432 Adc & Dac
DAC
fs = 1/Dt
Signal has frequencies 0 to ½ fs
1
Digital-to-Analog Converter (DAC)
R1 = 10 kΩ
2 bit DAC
R0= 20 kΩ
R2 = 10 kΩ
3 bit DAC R1= 20 kΩ
R0= 40 kΩ
Range
0 to 3.3V
Resolution
3.3V/15 = 0.22V
Precision
4 bits
16 alternative 3,5 4-bit DAC
Measured Analog Output (V)
Speed 3,0
2,5
Monotonic
2,0
1,5
1,0
0,5
0,0
0 5 10 15
Digital Input
6
2
R-2R Ladder DAC
Digital Inputs VOUT Expression VOUT
ADC
32
28
24
20
16
Discrete digital signal
12
0
0 1 2 3 4 5 6 7 8 9 10
Time (s)
3
Analog to Digital Methods
10
10
11
12
4
Sample-And-Hold Circuit
13
ADC on MSP432
Sampling Range/Resolution
2.5V internal reference voltage
0x000 at 0 V input
0x3FFF at 2.5 V
resolution = range/precision
= 2.5V/16384 alternatives < 1mV
Actual resolution dominated by noise
Improve signal to noise ratio (SNR)
Slow down ADC (take longer to sample)
Analog filtering, ground shield
Digital filtering (average multiple samples)
14
ADC on MSP432
15
5
ADC on MSP432
Analog in
Software
initiated
Digital
16
ADC14 | Overview +
14-bit Accuracy
INL <= +/- 2 LSB;
DNL <= +/- 1 LSB
ENOB 13-bit I/
REF Voltage Select
32-input channels P
M
Single-ended & differential Inputs u
l
Sample / Hold
t
2 Window comparators i A/D
High interrupt p Clock
l
Converter
Low interrupt
e
In [Between] interrupt x
e
r
Separate internal channels for
AVcc and TempSensor ADC14 Memory Registers
17
external Reference
0
internal 1
32-input channels
external
0 Differential 14-bit ADC Enhanced
internal 1 Measurement Core Clock
external
0
internal 1
...
Enhanced 14-bit
Interrupt
ADC Window
Memory Comparator
18
6
ADC14 | Differential Measurement
• Combine input channels to create differential input channels
VREF+
A1 A1 voltage
ADC14MEMx
∆ Difference
A2 A2 voltage Register
VREF-
Internal
Channel
Mapping
0
1 • Internal inputs include the temperature
sensor and battery monitor
0
1
• See the device datasheet to see what
internal inputs are available on what
...
20
ADC on MSP432
Initialization
Step 1. We configure the reference for 2.5V
Step 2. We disable the ADC by clearing the ENC bit.
Step 3. We wait for BUSY to be zero, in case there is a conversion
in progress.
Step 4. We set the ADC mode to single sample, SMCLK, divide by
1, 32 clocks for SHM
Step 5. We set the conversion address, 14-bit mode and turn on
the reference.
Step 6. We set the 2.5V reference and select channel 6 (P4.7).
Step 7. We disable interrupts on the ADC.
Step 8. We set the SEL0 and SEL1 bits to specify analog input.
Step 9. Lastly, we set the ENC bit to enable the ADC.
21
7
ADC on MSP432
return(data)
22
ADC on MSP42
//------------ADC0_In------------
ADC_In
// Busy-wait analog to digital conversion.
// 0 to 2.5V
Busy
// Input: none, Status
// Output: 14-bit result, 0 to 16383 Idle
uint32_t ADC_In(void){ Start
while(ADC14CTL0&0x00010000){}; ADC
ADC14CTL0 |= 0x00000001;
while(ADC14IFGR0&0x01)==0){}; Busy
Status
return ADC14MEM0;
} Complete
Read data
return(data)
23