Do you have any references?
Hi Javier,

Originally Posted by
JavPar
Hello everyone,
I am using a PIC18F4620 to read voltages but I am having a problem where if I read anything in between 0 or 5 volts, the voltages readings are erratic or oscillate. I have tried using resistors or capacitors on the ADCIN pin but nothing seems to work. I have been trying to solve these for weeks now I have done a lot of research but can't find anything that gives light to what the problem is. I am powering my project with a USB port.
I also noticed that if I disconnect the cable that goes to the ADCIN pin, I still get erratic numbers instead of reading 0. I have tried with code to get an average reading but this makes the code run slow.
Any help on this will be highly appreciated. ....
Javier.
Don’t forget that the A/D module relies on an accurate, known, reference voltage, to compare to an unknown voltage. If your reference is your supply voltage then your supply voltage has to be rock solid. If you are switching loads attached to the supply / reference then the supply has to switch these loads without changing voltage.
You still can use A/D input filters but if the reference voltage is not stable your readings will reflect the variations.
Edited to add: Be sure your DEFINES are in Upper Case
-Adam-
Last edited by Pic_User; - 16th December 2008 at 17:14.
Reason: Added: Be sure your DEFINES are in Upper Case
Ohm it's not just a good idea... it's the LAW !
Bookmarks