Good day.
I have been doing a small project with a pic16f88 chip. The chip controls the motor speed by using the potentiometer. I am using assembler to program and so far is have been able to set up some ports but i am having some difficulty setting up the analogue to digital converter. The potentiometer is attached to port 1(AN2). The motor is attached to RB0 of the pic chip.
That is what i have for the converter.
Any assistance would be greatly appreciated
I have been doing a small project with a pic16f88 chip. The chip controls the motor speed by using the potentiometer. I am using assembler to program and so far is have been able to set up some ports but i am having some difficulty setting up the analogue to digital converter. The potentiometer is attached to port 1(AN2). The motor is attached to RB0 of the pic chip.
Code:
;Analog to Digital Converter
clrf ANSEL
movlw b'00000100' ;Set pin to analog
movlw ANSEL
movlw b'00110000' ;Ref Voltage to external pins
movwf ADCON1
movlw .1 ;AD format select bits
movwf ADFM
movlw b'10000000' ;Analog Clock
movwf ADCON0
bsf ADON,1 ;ADC switch on
That is what i have for the converter.
Any assistance would be greatly appreciated