I am having problems getting the ADC on a PIC16C74A to work. The conversion is being done in sleep mode with the ADC using the RC osc. It wakes up and jumps to the interupt vector, but the data in the ADRES register is always 255. I am using internal vref and have put every voltage possible on the pin i am trying to sample. I have that pin set as annalog in one of the adcon registers, and as Input(TRISA = 0x00). I am Operating at 4Mhz. I am allowing 2 ms for setteling time after i turn the ADC on before setting the GO_DONE bit, but I have tried the recomended minimum of 8us also. HELP! here are some code fragments that I am using. If anyone has any ADC code fragments that are NOT for the 16c71 or 72 I would appreciate it greatly! INIT ;set up in page 1 first BSF STATUS,RP0 ;PAGE 1 ;ALL RA PINS ARE ANALOG MOVLW 0x00 MOVWF ADCON1 ;ADCON1 ;make port a all inputs - for A/D MOVLW 0xFF MOVWF TRISA ;make b all outputs MOVLW 0x00 ;ALL OUTPUT MOVWF TRISB ;PORT B ;make c all outputs MOVLW 0x00 ;ALL OUTPUT MOVWF TRISC ;PORT C ;enable intereupts for a/d BSF PIE1, ADIE ;go back to page 0 BCF STATUS,RP0 ;PAGE 0 ;done! RETURN ;ADC - Analog to digital conversion routine ; assumptions: port# is a pin set up to be analoge ; operands : ADCPORT port# to read ; returns: ADCRES result of the conversion - can be same as ADCPORT ADC NOP ;enable periferal interupts BSF INTCON, PEIE BSF INTCON, GIE ;clear carry bit for upcomming shift MOVLW 0x00 ADDLW 0x00 ;ADCPORT's lowest 2 bits contain the 3 bits used for channel select. ;set port # up for use with template of ADCON0 RLF ADCPORT, F RLF ADCPORT, F RLF ADCPORT, W ;mix port# with template of ADCON0 IORLW 0xC1 ;place command in ADCON0 MOVWF ADCON0 ;adc is now on, wait for signal setteling 8us at 4Mhz ;********what the hell, wait for 2 ms, we have time to spare MOVLW 0x02 MOVWF DLYMSA CALL DLYMS CLRF ADRES ;start conversion BSF ADCON0, GO_DONE ;wait for conversion to complete SLEEP ;put result in desired register MOVF ADRES, W MOVWF ADCRES ;turn off A/D for now ; BCF ADCON0, ADON ;done RETURN ;interupt vector points here SERVICE_INT MOVF ADRES, W MOVWF PORTB CALL TONE ; wait 2 seconds MOVLW 2 MOVWF DLYSA CALL DLYS ; CLRF PORTB ;clear a/d interut flag, just incase BCF PIR1, ADIF RETFIE