Analog-to-Digital Converter (ADC)
TMS320F2837xD Microcontroller Workshop - Analog Subsystem 6 - 19
ADC Conversion Result Registers
16-Bit Mode
Differential – two input pins (ADCINxP & ADCINxN)
Input voltage is the difference between the two pins
External reference (VREFHI and VREFLO)
LSBMSB
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AdcnResultRegs.ADCRESULTx n = a - d x = 0 - 15
AdcnResultRegs.
ADCRESULTx
3.0V 0V FFFFh 1111|1111|1111|1111
1.5V 1.5V 7FFFh 0111|1111|1111|1111
45µV
Signed Input Voltages
How Can We Handle Signed Input Voltages?
Example: -1.5 V
≤ V
in
≤ +1.5 V
1) Add 1.5 volts to the
analog input
V
in
1.5V
ADCIN0
GND
VREFLO
-
+
R
R
R
-
+
R
R
ADCA
#include “F2837xD_Device.h”
#define offset 0x07FF
void main(void)
{
int16 value; // signed
value = AdcaResultRegs.ADCRESULT0 – offset;
}
2) Subtract “1. 5” from the digital result