Hi,
I need to control the speed of a motor and modified some of Peter Anderson's code to test my H-bridge circuit. The code runs fine on an 08M chip but when I transfer it to a 14M chip there is no output. As far as i can see they are both supposed to use pin2 as the output and that's how I've got the circuit connected. Can anyone point me in the right direction?
Many thanks in advance!
Code:
---------------------------------------------------------
symbol PWMDuty = B0
symbol Counts = B1
symbol PWMDuty4 = W1
low 2
main: PWMDuty = 75
do
PWMDuty4 = PWMDuty * 4
pwmout 2 , 249, PWMDuty4
pause 50
PWMDuty = PWMDuty + 1
loop while PWMDuty < 250
pause 2000
do
PWMDuty4 = PWMDuty * 4
pwmout 2 , 249, PWMDuty4
pause 50
PWMDuty = PWMDuty - 1
loop while PWMDuty > 75
goto main
I need to control the speed of a motor and modified some of Peter Anderson's code to test my H-bridge circuit. The code runs fine on an 08M chip but when I transfer it to a 14M chip there is no output. As far as i can see they are both supposed to use pin2 as the output and that's how I've got the circuit connected. Can anyone point me in the right direction?
Many thanks in advance!
Code:
---------------------------------------------------------
symbol PWMDuty = B0
symbol Counts = B1
symbol PWMDuty4 = W1
low 2
main: PWMDuty = 75
do
PWMDuty4 = PWMDuty * 4
pwmout 2 , 249, PWMDuty4
pause 50
PWMDuty = PWMDuty + 1
loop while PWMDuty < 250
pause 2000
do
PWMDuty4 = PWMDuty * 4
pwmout 2 , 249, PWMDuty4
pause 50
PWMDuty = PWMDuty - 1
loop while PWMDuty > 75
goto main