The file single_ended.c, which is an ADC example created by TI. It was included with the Code Composer download.
I used this link because they also had multiple sensors that needed reading
http://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/200521.aspx
I used this piece specifically:
I was accidentally putting "ADC_CTL_IE", which is an interrupt flag, on each configure step. So it would read the first voltage correctly, but the other ports were reading strange results.ADCSequenceStepConfigure(ADC0_BASE, 0, 0, ADC_CTL_TS);ADCSequenceStepConfigure(ADC0_BASE, 0, 1, ADC_CTL_CH0);ADCSequenceStepConfigure(ADC0_BASE, 0, 2, ADC_CTL_CH1);ADCSequenceStepConfigure(ADC0_BASE, 0, 3, ADC_CTL_CH2);ADCSequenceStepConfigure(ADC0_BASE, 0, 4, ADC_CTL_CH3);ADCSequenceStepConfigure(ADC0_BASE, 0, 5, ADC_CTL_CH8);ADCSequenceStepConfigure(ADC0_BASE, 0, 6, ADC_CTL_CH9 | ADC_CTL_IE | ADC_CTL_END);
Setting up PuTTY
This is used in order to read the digital numbers.
https://docs.google.com/document/d/1vS1P7lHgfN0qNN-VUYzAmbf1uEs35KgN65zdVGpilhs/edit?usp=sharing
UART and ADC code added to existing code
https://docs.google.com/document/d/1jRJDIFJe60oUCF9FxPxIToOBODayL5LCVNqKEs4tatw/edit?usp=sharing
Below are pictures of ADC working
The list below explains the voltages used
Sensor 1: 0.5V
Sensor 2: 1.0V
Sensor 3: 1.5V
Sensor 4: 2.0V
Sensor 5: 2.5V
Next, I put each one to 0V. For the last two samples, all of the power supplies were set to zero.
Lastly, I connected all the ports to the same power supply