This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Ambiguous working of the ADC

I managed manage to get the ADC working, initially I thought the ADC is giving me the correct values but after a while I noticed that the values in the array often get exchanged with each other or sometimes repeat , for example I have 1 pin at Vcc while 3 at ground but still some times 2 of the values come out to be maximum i.e. 4095? This happens after I repeatedly start and stop the debugging process. I've no clue why the ADC is behaving this way.

Also I noticed that when I'm reading the values, inside the ADCSequenceDataGet() function the number of samples read (i.e. ui32Count) increments to 8 before restarting, where as I'm only using 4 steps? Shouldn't this restart after counting till 4, when the IE bit would be set? May be I haven't configured my ADC properly. I've attached the my code below.

Please let me know where I've gone wrong.

Thanks.

6557.adc3.cpp

  • Hello Arsalan

    Do you have the debugger window open which shows the ADC Register Space?

    Regards
    Amit
  • Hi Arsalan K.

    >I have 1 pin at Vcc while 3 at ground but still some times 2 of the values come out to be maximum i.e. 4095? There is necessary settings to ADC0 to make it behave during samples taken. Downloads Tivaware code samples, how to configure ADC makes it work ok.

    software-dl.ti.com/.../index_FDS.html

    1. What exactly do you mean by 1 pin at Vcc -- while 3 at GND -- is that the ADC channel number AN1 input at Vcc?
    2. Please post your ADC configure code using rich formatting, IE (copy paste) we all can have a better look.