Norlin thanks opr answer, I think you forget to place some details ...
work with MPLAB and the programming language is in asm.
XTAL =48MHZ
and I read the datasheet and had already made a code but it is not correct, have you help me a bit ..... thanks in advance.
LIST P=18F4620
#include <P18F4620.INC>
;*****************************
;header goes here
;****************************
cblock 0x80
d1
endc
org 0x00
;delete some ports and placed as an input analog signal RA0
CLRF PORTA
CLRF LATA
CLRF W
movlw 0x01
movwf TRISA
CLRF PORTB
CLRF LATB
CLRF TRISB
CLRF PORTE
CLRF LATE
CLRF TRISE
;in ADCON1 choose as reference voltage VDD and VSS
; and PCFG3 :: PCFG0 <<<<.... 1110 AN0 =RA0 SIGNAL ANALOG
;
ini:
; 0x0E= 0000 1110 .......>>> ADCON1
movlw 0x0E
movwf ADCON1
play: movlw 0x01
movwf ADCON0
; then enable a module A / D ADON = 1
movlw 0xBE
movwf ADCON2
;0XBE=1011 1110 ..... >> ADCON2
bsf ADCON0,2
; right justified ADFM = 1
main:
btfsc ADCON0,2
goto main
; is one call delay_2Tad
; is zero goto play
delay_2Tad:
movlw 0x15
movwf d1
loop1
decfsz d1,1
goto loop1
return
end
this is the program compiles fine on me but it's badly MPLAB,
I hope you help me ..... I have some time with this, perhaps I'm wrong ...
thanks from now
LEEN H.