Right now the program on the web has a 'issue'. When it is working properly you should be able to obtain 8 bit results by multiplying your reference by 4 before you enter it. So tell it reference is 80 and put zero in ADHIGH and it will convert the eight bits in ADLOW. Me thinks.... A work around right now is to take the code you have and mod it a little. the code for the high order bit of the convert with 10 bits and 20 volt reference is as follows ----- ; for bit 0 10 CVDEC00 BTFSS ADHIGH,06 GOTO CVDEC01 MOVLW D'01' ADDWF CVD0----- The remark tells you that the msb (bit 0 of 10 bits) has a value of 10. What you want to do is to change the bit test from bit 6 of ADHIGH to bit 0 of ADLOW. And it will use CVD0as ten's digit, CVD1 as units and CVD2... as the decimals. The next section should be changed to test ADLOW bit 1 and it adds a 5 to CVD1. You can see what each section is doing by looking at the value in the remark preceding it. What you get from the web is just code, you can modify it any way you wish and all the time "what you see is what you get.". I am trying to say that nothing is going to affect or change the code except you. So if you modify code as above, you will use CVD0, CVD1 decimal point CVD2. But I would recommend you use CVD3 while testing the bits and when you normalize the digits, start at CVD3 and work up through CVD1 so you get better precision. Look at the code and see what it is doing, you will have no problem understanding it and making mods for your needs. Bill ----- Original Message ----- From: "Chetan Bhargava" To: "Microcontroller discussion list - Public." Sent: Sunday, January 15, 2006 10:51 PM Subject: Re: [PIC] ADC code generator >I generated code for the full scale reading of 20 > > As my adc is 8 bit so I clear out ADHIGH and mov ADRES to ADLOW. > > What I get in CVD00 - CVD05 is 049810 Is this what should I get? > > > > ;we are trying the new sub from piclist CVDEC > movlw 0xff > movwf ADLOW > clrf ADHIGH > call CVDEC > > movf CVD03,w > movwf hundreds > movf CVD04,w > movwf tens > movf CVD05,w > movwf units > call display ; display 3 digits > > > > On 1/15/06, James Newton, Host wrote: > >> CVD00 is the most significant digit or MSD of the result. Please note >> that >> we JUST put that up the other day so I'm not totally sure it is correct. > > -- > Chetan Bhargava > Web: http://www.bhargavaz.net > Blog: http://microz.blogspot.com > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist