This is the code i found on some discussion:
adc_sync_set_inputs(&ADC_0,1,0x18,0);
adc_sync_read_channel(&ADC_0, 0, buffer, 2);
A1_Val=buffer[0]+buffer[1]*256;
//A2
adc_sync_set_inputs(&ADC_0,2,0x18,0);
adc_sync_read_channel(&ADC_0, 0, buffer, 2);
A2_Val=buffer[0]+buffer[1]*256;
//A3
adc_sync_set_inputs(&ADC_0,3,0x18,0);
adc_sync_read_channel(&ADC_0, 0, buffer, 2);
A3_Val=buffer[0]+buffer[1]*256;
But that doesn't seem to work.
I have set clock with divider to be 2Mhz as i found it should be the max clock for ADC.
Is there any example code to try, since it seems that i cannot get any real values from ADC. i get random about 1800 values even the pin is grounded.
As getting know to ADC i'm wondering that could i use async free running mode and read values as i need. I could also use that same mode in other function to setup window monitoring to make interrupt engine to get values from TC. Am i totally lost with my ideas?
If not any example coge how to do those?