I think Chris has nailed it. This oupute described could easily result from reading the ADRESH register twice. The most likely reason for this is failure to switch banks. ADRESH and ADRESL are at the same address; except one (ADRESH) is in bank 0 and the other (ADRESL), is in bank1. To use the lower eight bits, use: bsf STATUS, RP0 ; switch to Bank1 movf ADRESL ^ 0x80, W bcf STATUS, RP0 ; switch to Bank0 Then you'll have ADRESL in the w register. Andrew ________________________________________________ Get your own "800" number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag ---- On , Chris Emerson (pic@NOSREME.ORG) wrote: > On Fri, Jun 18, 2004 at 01:31:24PM -0700, dimov stefan wrote: > > But when I'm changing the voltage gradually from 0V > > to 5V the LCD shows only four values respectivly : 0, > > 257, 514, 771. > > Where is the culprit? > > I bet there's a typo, and you're using ADRESH twice instead of > ADRESH:ADRESL. Those numbers in hex are 0x0000, 0x0101, 0x0202, and 0x0303, > which look rather suspicious. > > Chris > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body