I am using PIC18F26K83 which has 12 bit ADC in it and I want to measure voltage values on a specific pin. Voltage values will be between 10 V and 30 V. I supply my MCU with 4.9 V. And from my research it is equivalent to voltage reference ( I am not sure in this point.). Which means if the voltage value on the a pin is 4.9 V I will get 4095 from ADC and if the voltage value is 2.45 V ADC value will be 2048. Is it correct? My main question is: can I measure voltages that are between 10 V and 30 V with 4.9V voltage reference? If no, is there a way to measure that range with ADC without changing the voltage reference? Thanks.
Edit: So I added a voltage divider circuit now I divide that voltage by 11. In that case calculations looks like: (4.9 * adc_out / 4096) *11 = voltage_value. It looks like only way is to use voltage divider. We can close the topic.
Yes, you need a hardware divider circuit to measure 10V.
And please have a look at the Absolute Maximum Ratings in the Electrical Spezifications:
The maximum voltage for any pin is VDD + 0,3V !!!
So any higher voltage will destroy the chip.