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.