I am trying to be able to control the speed of a basic dc motor through an input on the pic 08m. I have created a circuit where the motor goes through a mosfet transistor (IRF630). I am using the following code to test if I can get different speeds out of the motor:
main:
for w0 = 0 to 100 step 1 'start a loop to ramp up pwm
pwmout 2,255,w0
pause 1000
next w0
for w1 = 100 to 0 step -1
pwmout 2,255,w1
pause 1000
next w1
goto main
Nothing seems to happen when I do this, where if I type "High 2" then the motor works.
Any suggestions?????
main:
for w0 = 0 to 100 step 1 'start a loop to ramp up pwm
pwmout 2,255,w0
pause 1000
next w0
for w1 = 100 to 0 step -1
pwmout 2,255,w1
pause 1000
next w1
goto main
Nothing seems to happen when I do this, where if I type "High 2" then the motor works.
Any suggestions?????