I have a routine for 8bit AD convertion using 16c924 chip as follows. After convertion the digital value is stored in ADRES. Now I'm changing the processor to 16f946 where it uses the 10 bit with ADRESL and ADRESH register locations to save the values. Now will ADRES of 8bit A/D value be as same as ADRESL in 10BIT A/D?(note that the routine written for 10bit is different with respect to the micro)
READ_POT ; setting of 0 =2.5 volt = 127 count
BCF ADCON0,2
movlw B'01000001' ;select FOSC/8,ch0.enable A/D
movwf ADCON0 ;turn on A/D.
clrf ADRES ;clr result reg.
movlw .9 ;ADD DELAY
movwf AD
movf AD,1
BTFSC STATUS,Z
GOTO routine
routine1 DECFSZ AD,1
goto routine
routine bsf ADCON0,2 ;start conversion
WAIT
btfsC ADCON0,2 ;a/d done?
goto WAIT
MOVF ADRES,W
MOVWF POT ;SAVE RESULT IN LOCATION POT
READ_POT ; setting of 0 =2.5 volt = 127 count
BCF ADCON0,2
movlw B'01000001' ;select FOSC/8,ch0.enable A/D
movwf ADCON0 ;turn on A/D.
clrf ADRES ;clr result reg.
movlw .9 ;ADD DELAY
movwf AD
movf AD,1
BTFSC STATUS,Z
GOTO routine
routine1 DECFSZ AD,1
goto routine
routine bsf ADCON0,2 ;start conversion
WAIT
btfsC ADCON0,2 ;a/d done?
goto WAIT
MOVF ADRES,W
MOVWF POT ;SAVE RESULT IN LOCATION POT