Hi, I have been trying to get the ADC working on a PIC 12F683, but I can only read the upper byte successfully (I vary a potentiometer and output a flashing LED when a particular bit gets set). All of the bits in the lower byte (from ADRESL) read as zero despite the fact that the code for the lower byte is almost identical to the upper byte. I am using the *internal* oscillator running at 1 MHz. Any help would be great as I have reached a dedend! The code fragments are: LIST P=12F683 INCLUDE "p12f683.inc" __config 30C4H ; used for 12f683 Power up timer, Int RC/No clockout #DEFINE LED_ON BSF GPIO,2 ; switch LED on #DEFINE LED_OFF BCF GPIO,2 ; switch LED off #DEFINE BANK0 BCF STATUS,RP0 ; Select BANK 0 #DEFINE BANK1 BSF STATUS,RP0 ; Select BANK 1 ; variables defined here from 20H onwards ORG 00H ; reset vector GOTO MAIN ORG 005H ADC_10BIT CLRF ADC_LO CLRF ADC_HI BANK1 MOVLW B'01110001' ; RC, GP0 analog, rest digital I/O MOVWF ANSEL BSF TRISIO,0 ; set GP0 to i/p BANK0 MOVLW B'10000001' ; right justified, Vdd as ref, AN0 MOVWF ADCON0 CALL ONE_MS ; my delay BSF ADCON0, GO ; start conversion LP3 BTFSC ADCON0, GO GOTO LP3 ; poll to see if conversion complete MOVF ADRESH, W MOVWF ADC_HI BANK1 MOVF ADRESL, W MOVWF ADC_LO BANK0 RETURN INIT_PORTS_OP CLRF GPIO MOVLW 07H MOVWF CMCON0 ; set GP0, GP1 and GP2 as digital I/O BANK1 CLRF ANSEL MOVLW B'0001011' MOVWF TRISIO BANK0 RETURN MAIN BANK1 MOVLW 040H MOVWF OSCCON BANK0 CALL INIT_PORT_OP SAMPX CALL ADC_10BIT CALL ONE_MS BTFSC ADC_LO, 4 ; I am checking that this bit changes as I vary the pot. GOTO NO_LED LED_ON CALL MY_DELAY LED_OFF CALL MY_DELAY NO_LED GOTO SAMPX Many thanks, Steve -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist