Hello ALL,
I am trying to use TM4C123G , ADC0, Sequencer 1, to acquire readings from two sensors connected as foolow:
Sensor 1 --- AIN0 (PE3)
Sensor 2 --- AIN1(PE2)
the code that acquire samples is:
unsigned long ADC0_InSeq1(void)
{
unsigned long result, result2;
ADC0_PSSI_R = 0x00000002; / / initiate SS1
while((ADC0_RIS_R&0x02)==0){}; // wait for conversion done
result = ADC0_SSFIFO1_R&0xFFF; // read result
result2 = ADC0_SSFIFO1_R&0xFFF;
ADC0_ISC_R = 0x0002; // acknowledge completion
return result2;
}
but if any one sensor on input pin is disconnected the value of other connected sensor is returned at "result2" by function above.
How can i properly and seperately acquire individual sensor values?
I think it has to do with ADC0_sequencer1_ FIFO1 processing?