Hello Avdit,
Here are answers to your queries:
1. Analog input refers to the voltage you have applied on the pin like 1V or 3V. Maximum voltage can be the MCU supply voltage, ie, either 3.3V or 5V. 256 is the decimal number.
2. suppose your supply is 3.3V, resolution is 8bits, then 3.3V --> 255, 0.14V --> (0.14/3.3)*255 = ~10. So your ADC value will be around 10.
3. this is the number of bits for the adc result. like if 8bit, then maximum voltage will corresponds to 255(2^8-1), if 10bits, it will be 1023 (2^10-1) and so on..
Regarding code:
It seems you continuously want to read ADC. In this case, you can enable continuous conversion:
ADC_SC1_ADCO = 1; /*Continuous conversion enable*/
While reading the result:
while(!ADC_SC1_COCO);
result = ADC_RL;
It should work. If it doesn't, let me know where your code is getting hanged.
Thanks and Regards
Arpita Agarwal