Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help needed motor speed control with pic16f88 and potentiometer

Status
Not open for further replies.

rene01

New Member
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 am just using a potentiometer to control the speed.

No difference really..... The input would still be 0-5v to do the same job....The code I posted WAS for a pot... Use that as a start.
 
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
 
i should mention that my potentiometer is connected to RA0/AN2. and i see i copied the code wrong so it does build correctly
 
Status
Not open for further replies.

Latest threads

Back
Top