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
Summary of Contents for C28 Series
Page 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Page 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Page 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Page 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Page 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Page 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Page 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Page 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Page 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Page 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...