Hi Dwayne again, > You have a nice little 60 uSec delay there that does no good whatsoever > where you have it. Move that delay between the 'select channel RA0' and > 'start conversion'. > > This is what I mean: > > > START SCHRA0 ; SELECT CHANNEL RA0 > > > > MOVLF .20,TEMP ; THIS LINE IS 20 > > DECFSZ TEMP,F ; WAIT A WHILE > > GOTO $-1 > if I am wrong I tried with out the delay did not work properly. I do not know. > > > > BSF ADCON0,GO ; START CONVERSION > > > > BTFSC ADCON0,GO ; TEST FOR END OF CONVERSION > > GOTO $-1 > > Try it! > > 2) You may have a misunderstanding of how W is used. You do the following: > I am not sure what do you mean? > >> MOVF ADRES,W ; LOAD A/D RESULT INTO W > >> COMF ADRES,W ; COMPLIMENT IT > >> > >> MOVWF ADC_RESULT ; STORE IT > >> MOVWF PORTB > > The first instruction 'movf adres,w' copies the value stored in adres into W. > yes > The next instruction 'comf adres,w' takes the value stored in adres, > compliments it, and stores the result in W. Notice that what was in W from > the first instruction is now overwritten by the result of the second > instruction. yes > The first instruction (movf adres,w) is not necessary. > this code wasn't done when I posted to pic list seeing extra instruction specially this one "above" doesn't even bother I do not thing you should even worry about it. Hope this helps. > dwayne > > Dwayne Reid > Trinity Electronics Systems Ltd Edmonton, AB, CANADA > (403) 489-3199 voice (403) 487-6397 fax Andre