--- Gordon Varney wrote: > What am I doing wrong??????? I would appreciate any > help. > > Note: this code works on a PIC12C671. > void ADtest(void) { //read the input voltage > do { > restart_wdt(); > // value = read_adc(); //read > the ADC > #asm asis > bsf 0x1F,0x0 > nop > bsf 0x1F,0x1 > nop > ag: > btfsc 0x1F,0x1 //I do not see > the compiler turning > this bit on or off > goto ag //using the > read_adc() command, > so I wrote it in ASM. > movf adresh,W //I get a small > variation in the output > but no ADC to speak of. > movwf value > bcf 0x1F,0x0 > #endasm Gordon, the 12C671 is an 8-bit ADC, the 12F675 is 10-bit. You need to select if you want the value left-justified or right-justified in ADRESH and ADRESL (look at the ADFM bit in ADCON0). If you have it right-justified, then ADRESH only has the top 2 msb's, and you won't get much response! hope this helps, Eric __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body