Let's Make Robots!

Motor speed and direction control with picaxe 20x2

Hello all,

i have just recently received a picaxe 20x2, picaxe 20x2 project board, 2 geared dc motors and a bunch of ldr's!

my plan is to make a line following robot. I have worked out how to sense the line with the ldr's but cannot get the picaxe to run two motors simultaneously!!  

somebody please help!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Are you using a motor driver? --Dont connect the motors to the chip!

What is connected to what? A clear (not blurry) picture would be great.

Any code snippits would be great.


I am using the L293D Motor driver and i can control the speed and direction of one motor but when it comes to controlling two motors they both either don't move or one moves really slowly.

I am working on a schematic!

Starting with a motor driver is a good thing.

Now we just need that picture or schematic and we can help.

ok here is the schematic, the only difference is that the cad software that i used didn't have the 20x2 so i used an 08M chip instead!

All of the pins still connect to the same connections so hopefully it will help.PICAXE Motor Drive circuit-08M

Make sure your 5v PS can source enough current for everything and also your motors will work with only about 3v. Also try seperating the logic and motor power supplies once youve checked those things.

You are showing only one PWM output -this is why you only have one speed control.



OK so if i connect all input pins on the l293d to pwm outputs on the 20x2, i should have speed control for both.

is the rest of the circuit correctly connected??

You will need to know how PWM and a H-bridge works. With 4 PWM signals, you will have fwd, rev and brake depending on how they are implemented. I think Picaxe has a HPWM command as well but so far, no one has been able to figure it out --you would be the first.

I was just having a look at the pinout diagram of the 20x2 in the PICAXE manual and it showed that it had only 1 pwm output pin, but 4 or 5 hpwm outputs. is this a mistake and is there more pwm pins or do i just have to use hpwm??

I am not familiar with the 20m2's --I would need to see the manual. What page was the HPWM stuff on again? I can't seem to find it. I really can't help much, I'm afraid, without that page number. --Again, the page number from the manual that deals with the HPWM command, I need it.