
aaguilar4
-
Content Count
11 -
Joined
-
Last visited
Reputation Activity
-
aaguilar4 reacted to gwdeveloper in ADC10 Using Data Transfer Controller
I use the DTC for almost all of my ADC conversions on the Launchpad.
If you have it setup following the demo codes. Just make a few changes for easy access to the data.
Declare a global like: (replace 32 with how many samples you're taking; 4 channels x 1 sample = 4 total)
volatile int ADCdata[32];
And in your ADC10 setup change ADC10SA like:
ADC10SA = (unsigned int)ADCdata;
And ADCDTC1 for the number of transfers to make:
ADC10DTC1 = 32;
And as an example (here my program samples 1 channel 32 times and then averages them)
thermistor = 0; for (i=0; i < 32; i++) { thermistor += ADCdata[i]; } thermistor /= 32;
You won't need the ADC10 to interrupt anymore if you're set the DTC for continuous.
-