Analog-to-Digital Converter
Numerical Format
How do we Read the Result?
How do we Read the Result?
Integer format
Integer format
RESULTx
RESULTx
ACC
ACC
Data
Data
Mem
Mem
bit shift right
bit shift right
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
0
0
0
0
0
0
0
0
15
15
0
0
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
0
0
0
0
0
0
0
0
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
x
x
x
x
x
x
x
x
x
x
x
x
Example: read RESULT0 register
Example: read RESULT0 register
#include "DSP281x_Device.h"
void main(void)
{
Uint16 value; // unsigned
value = AdcRegs.ADCRESULT0 >> 4;
}
#include "DSP281x_Device.h"
#include "DSP281x_Device.h"
void main(void)
void main(void)
{
{
Uint16 value;
Uint16 value;
// unsigned
// unsigned
value =
value =
AdcRegs
AdcRegs
.ADCRESULT0 >> 4;
.ADCRESULT0 >> 4;
}
}
What About Signed Input Voltages?
What About Signed Input Voltages?
Example:
Example:
-
-
1.5 V
1.5 V
≤
≤
V
V
in
in
≤
≤
+1.5 V
+1.5 V
1) Add 1.5 volts to analog input:
1) Add 1.5 volts to analog input:
V
V
in
in
1.5V
1.5V
Input
Input
Ch. x
Ch. x
V
V
DD
DD
GND
GND
V
V
DDA
DDA
ADCLO
ADCLO
-
-
+
+
R
R
R
R
R
R
-
-
+
+
R
R
R
R
C28x
C28x
#include "DSP281x_Device.h“
#define offset 0x07FF
void main(void)
{
int16 value; // signed
value = (AdcRegs.ADCRESULT0 >> 4) – offset;
}
#include "DSP281x_Device.h“
#include "DSP281x_Device.h“
#define offset 0x07FF
#define offset 0x07FF
void main(void)
void main(void)
{
{
int16
int16
value;
value;
// signed
// signed
value = (
value = (
AdcRegs
AdcRegs
.ADCRESULT0 >> 4)
.ADCRESULT0 >> 4)
–
–
offset;
offset;
}
}
2) Subtract “1.5” from digital result:
2) Subtract “1.5” from digital result:
6 - 12 C28x - Analog-to-Digital Converter