HI
In my project i am using pic 18f65j50 microcontroller to remotely monitor and control smps..As of now i've programmed ADC of Pic
Pls tell me whether the codes are rite or wrong .The codes as given below
btw i have executed these codes in MPLAB AND the build was successded
Thank u pplIn advance..
In my project i am using pic 18f65j50 microcontroller to remotely monitor and control smps..As of now i've programmed ADC of Pic
Pls tell me whether the codes are rite or wrong .The codes as given below
Rich (BB code):
LIST P = P18f65j50
INCLUDE"P18f65j50.INC"
CBLOCK 0X20
RESULT1
RESULT2
ENDC
ORG 0X00
NOP
CALL START
CALL ACTION
START
CLRF PORTA
MOVLW B'00001011'
MOVWF TRISA,
BSF WDTCON,ADSHR
BCF ANCON0,PCFG0
BCF ANCON0,PCFG1
BCF WDTCON,ADSHR
CLRF TRISF
CLRF PORTF
CLRF TRISB
MOVLW B'01000100'
MOVWF ADCON0
MOVLW B'00000011'
MOVWF ADCON1
BSF ADCON0,ADON
BCF PIR1,ADIF
RETURN
ACTION
CLRF IDLEN
NOP
SLEEP
BSF ADCON0,GO
BTFSC ADCON0,GO
GOTO $-2
BSF WDTCON,SWDTEN
BSF PIR1,ADIF
MOVLB B'0000010'
MOVF ADRESH,W,1
MOVWF PORTF,1
MOVF ADRESL,W,1
MOVWF PORTB,1
RETLW 0
LAST
NOP
END
Thank u pplIn advance..
Last edited by a moderator: