Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
The maximum input voltage is 5.5V. That is what the pins can withstand without damage.
What you are describing sounds like you are getting too high readings for the voltage you applied. That makes me ask:
What is the reference for the A/D? Did you configure the reference input correctly?
i have test out the ADC input with applying DC voltage from power supply. when i adjust around 2 volts.. all the output LED are light up.. is my testing on ADC input wrong? A problem i see from my testing is without supplying any voltage input to PA2, 2 LED are already light up..
There is nothing wrong with your tests, but ..
At RA3 and RA2 pins you have Vref(+) and Vref(-) or you can select Vref(+)=Vdd and/or Vref(-)=Vss.
As VVV asked before, have you checked the Vref?
In the data sheet you can find a table on the ADCON1 register.
Tis table will give you information on what bits you have to SET or CLEAR to connect Vref(+) to Vdd or pin RA3 and Vref(-) to Vss or RA2. There are 4 bits responsible for thes options: PCFG3, 2, 1, and 0.
The easiest way will be to select option where Vref(+) goes to Vdd and Vref(-) goes to Vss. In this case you will have the range set by the supply voltage.
Otherwise you will have to connect external Vref to RA3 and set Vref(-) to Vss (if you want to use single-ended inputs).
but what about digital inputs. I need to detect if supply voltage is present. It may vary from 4.0 to 15V. If I'll make a voltage divider then at 4V the input is not high enough to detect HIGH voltage. Could I just add maybe a 1MOhm resistor in series to limit the current and connect it to 15V. or is the voltage that mathers?