i try to convert analog to digital using pic16f876 and input signal= 3v
Vref+=5v,Vref=0....so that we sould get 3*1024/5=614 decimal= 266 hex
when we make ADFM=1 and we use this code:
movfw ADRESL
movwf PORTC
movfw ADRESH
movwf PORTB
we get the result only the ADRESH=2 on portB and portC
but we do not get ADRESL whis equal to 66 on portC
why... could any on tell me how we make ADRESH on portB and the same tme
ADRESL=portC to get 2 on portB and 66 on portC
and this is the complete code :
list p=16f876
#include <P16f876.INC>
ERRORLEVEL -302
wait EQU 0x20
init
bsf STATUS, RP0 ; auf Bank 1 umschalten
movlw B'00000000' ; PortB alle output
movwf TRISB
movwf TRISC
bcf STATUS, RP0 ; auf Bank 0 zurückschalten
clrf PORTB ; alle LEDs ausschalten
clrf PORTC