---- START NEW MESSAGE --- Received: from cherry.ease.lsoft.com [209.119.0.109] by dpmail10.doteasy.com with ESMTP (SMTPD32-8.05) id ACAA119001FA; Fri, 30 Jan 2004 12:20:58 -0800 Received: from PEAR.EASE.LSOFT.COM (209.119.0.19) by cherry.ease.lsoft.com (LSMTP for Digital Unix v1.1b) with SMTP id <4.00CC53C9@cherry.ease.lsoft.com>; Fri, 30 Jan 2004 14:58:51 -0500 Received: from MITVMA.MIT.EDU by MITVMA.MIT.EDU (LISTSERV-TCP/IP release 1.8e) with spool id 4850 for PICLIST@MITVMA.MIT.EDU; Fri, 30 Jan 2004 14:58:45 -0500 Received: from MITVMA (NJE origin SMTP@MITVMA) by MITVMA.MIT.EDU (LMail V1.2d/1.8d) with BSMTP id 8703; Fri, 30 Jan 2004 14:58:00 -0500 Received: from www.cotse.net [216.112.42.60] by mitvma.mit.edu (IBM VM SMTP Level 430) via TCP with ESMTP ; Fri, 30 Jan 2004 14:58:00 EST X-Comment: mitvma.mit.edu: Mail was sent by www.cotse.net Received: from localhost (localhost[127.0.0.1]) (authenticated bits=0) by www.cotse.net (5.7.4/5.7.4) with ESMTP id i0UJvwn8005448 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 30 Jan 2004 14:58:00 -0500 (EST) (envelope-from cr_axtell@yahoo.com) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <401AB745.7000405@yahoo.com> Date: Fri, 30 Jan 2004 12:57:57 -0700 Reply-To: pic microcontroller discussion list Sender: pic microcontroller discussion list From: Bob Axtell Organization: BA http://beam.to/baxtell Subject: Re: [PIC:] 16LF877A A/D To: PICLIST@MITVMA.MIT.EDU In-Reply-To: Precedence: list X-RCPT-TO: Status: U X-UIDL: 371856564 James Nick Sears wrote: > Hello, > > I am trying to finish my datalogger project and I am having problems with A/D converters returning wrong values. I have one board programmed and working fine, while the next 4 that I have done all have the same problem so I am thinking I accidentally broke the software but I can't say 100% for sure. I am working now trying to get the working board programmed with the current program to see for sure but I have to do a little bit of wiring to connect a different supply to the board to get a high enough Vdd to program. The temperature sensor that I am connecting reads 23 degrees F on the bad boards rather than my 65-70F room temp on the good one (0.3922V instead of ~0.55 - 0.6V). > > I then programmed it to overwrite the temporary A/D values saved in user registers (which are later saved to EEPROM after the ISR completes) with 00000010 00000000, which is half of full scale and everything worked as expected (showed 0.625V in my PC software, which is half of my 1.25V reference) so I know that the EEPROM, Serial Comms, etc are not to blame. > > I have also measured the voltages at the PIC pins AN0,VRef+,and VRef- and they all look fine (around 0.6V,1.25V, and 0V, respectively). > > And finally I checked my A/D configuration (ADCON0 and ADCON1) and everything looks fine. > Conversion Clock: Fosc/32 (also have tried Fosc/64 - I am running a 4MHz Xtal by the way) > Channel 0 is selected > Port is configured for all analog inputs with Vref+ and Vref- on AN3 and AN2 > > My power supply looks pretty good. I get a 5-10mV dip when a pair of LEDs blink to show the the serial port is active and when that port is active the supply dips about 40mV in little pulses at about 15kHz which I gather are caused by the charge pump in the RS232 driver. In any case, with the serial cable unplugged I am looking at <=15mV p-p noise on the supply and the A/D still doesn't work right. > > Who's got the right idea??? > > Thanks, > Nick What does the hardware look like? Sometimes one PIC will work properly because its Analog Input can tolerate a high input impedance, whereas most of the others can't. Make sure that the references are VERY well filtered and that the input impedance is below 5K. A tiny cap can usually solve the input impedance problem. It shouldn't be an issue, but Fosc/32 at 4mhz is a LONG time for a conversion with a 10-bit A/D. You MIGHT be taking a lot longer than you think.I should think Fosc/4 should be the outside clock window at 4Mhz. I use the internal RC oscillator. --Bob -- Replies: NOTE-Script, EXE,BAT and COM files will be rejected by server -------------- Bob Axtell PIC Hardware & Firmware Dev http://beam.to/baxtell 1-520-219-2363 -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body .