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.
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
i appreciate the direction that you are pointing me too, but it seems that his projects is different to mine as i am just using a potentiometer to control the speed. I am having a lot of trouble getting it to go faster or slower and i do not know what else i can do.
I have used the code you posted. There seems to be a small issue as it will not build correctly so it is not working properly. Have tried adjusting my code in reference to your code. Could you give me any additional pointers as to where I should place the code, again, this would be greatly appreciated