> -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf > Of Cristiano Cesaretto > Sent: 20 February 2012 18:14 > To: Microcontroller discussion list - Public. > Subject: [PIC] ADC problem with PIC18F2458 >=20 > Hello. >=20 > I have used a PIC18F2458 to make a joystick controller that features 6 > 12-bit analog axins and 36 buttons. >=20 > Everything is cool but there is something strange with the 6th analog axi= s > (which is AN8 because AN6 and AN7 are not implemented). > Basically I never read an analog value less than ~85, which corrspond to > around 100mV. >=20 > The analog input usually is connected to a potentiometer but I also tried > to connect it to a ground trace, as near as possible to the USB connector= .. > but I got the same result. >=20 > I was wondering what you guys think. Could it be a configuration error? > The > other 5 channels work fine. >=20 > I can post the source code if necessary. Ensure your ADC acquisition time is large enough. If you make this too sma= ll then you get an ADC value that has some dependency on the previously sel= ected channel. The minimum acquisition time will depend on your source imp= edance, and the ADC section of the datasheet shows how to calculate this ti= me. Mike =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .