At 09:16 AM 10/17/2000 -0400, you wrote: >----- Original Message ----- >From: Olin Lathrop >To: >Sent: Tuesday, October 17, 2000 8:25 AM >Subject: Re: [PIC]: analog pins > > >> > > I though if an anlog pin was set as an output you could use it as >> > > an output pin capable of driving whatever. >> > >> > That's true, Tony. >> >> No, it's not. Some I/O modules will control the pin regardless of the >TRIS >> setting, or otherwise "take over" the operation of the pin. The A/D is a >> good example of this. > >The datasheets I've read have said that you must TRIS analogs as inputs if >you want to read the analog voltage. They say that if you TRIS the pin as an >output, the A/D can still happen, but that it will convert the pin voltage >as driven by the digital output. I stand ready to be corrected. > The following is straight out of my 16C7x d/s. All one has to do is figure out Mchp-engineer-speak. [it's kinda like reading "Brave New World" sometime, or was that "1984"?] Now, as I recall, everything worked as stated here, except for: "Pins configured as digital inputs, will convert an analog input." =========================== The ADCON1, TRISA, and TRISE registers control the operation of the A/D port pins. The port pins that are desired as analog inputs must have their corresponding TRIS bits set (input). If the TRIS bit is cleared (output), the digital output level (VOH or VOL) will be converted. The A/D operation is independent of the state of the CHS2:CHS0 bits and the TRIS bits. Note 1: When reading the port register, all pins configured as analog input channels will read as cleared (a low level). Pins configured as digital inputs, will convert an analog input. Analog levels on a digitally configured input will not affect the conversion accuracy. Note 2: Analog levels on any pin that is defined as a digital input (including the AN7:AN0 pins), may cause the input buffer to consume current that is out of the devices specification. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! use mailto:listserv@mitvma.mit.edu?body=SET%20PICList%20DIGEST