Hi all.
I am using an 08M2 to drive a motor through a FET with PWM.
I started out using two seperate power supplies, 4.5v for the picaxe, 6v for the motor, but have modified the circuit using a voltage regulator so only one power supply is needed.
The problem now is that the picaxe appears to be turning off and back on as though there is a random voltage drop on the supply, can the FET be drawing too much current?
Thanks.
I am using an 08M2 to drive a motor through a FET with PWM.
I started out using two seperate power supplies, 4.5v for the picaxe, 6v for the motor, but have modified the circuit using a voltage regulator so only one power supply is needed.
The problem now is that the picaxe appears to be turning off and back on as though there is a random voltage drop on the supply, can the FET be drawing too much current?
Thanks.
Code:
#picaxe 08M2
#no_data
setfreq m8
pwmout 2, 99, 200
symbol motorspeed = w0
symbol potsetting = w1
Main:
readadc c.1, b8 ' Reads pin6 for an analogue value and stores it in variable b1
let potsetting = b8*100
let w2 = potsetting/255
motorspeed = 4 * w2
pwmduty 2,motorspeed
goto main
Attachments
-
9.6 KB Views: 60
-
8.4 KB Views: 42
Last edited by a moderator: