Let's Make Robots! | RobotShop

Yes, you can use Pin5 on the PICAXE-08 Motor Driver

Use Pin5, despite the Picaxe documentation
MakerFaire_01.bas933 bytes

The documentation for the AXE023 motor driver board for the PICAXE-08 states that, "pin5 cannot be used with the PICAXE-08 system as this is the serial input pin".

However, Chris the Carpenter pointed out the PICAXE disconnect command, which you can find in PICAXE Manual 2. The manual states:

"The PICAXE chips constantly scan the serial download pin to see if a computer is trying to initialise a new program download. However when it is desired to use the download pin for user serial communication, it is necessary to disable this scanning."

The newer PICAXE-08M2 chip can use pin5 as in Input pin, in addition to its function as Serial In. Using the disconnect command at the beginning of the program allows you to use pin5 on the PICAXE-08M2 not only for serial communication, but as a digial input as well.

After the disconnect is used, you will need to do one of the following in order to download a new program to the PICAXE:

  1. use the reconnect command
  2. issue a reset comment
  3. perform a hardware reset, which you can do by cycling the power

Here's a code snippet:



disconnect 'allows use of pin5 as input



if pin3 = 1 and pin5 = 0 then

gosub backturnl

end if

if pin5 = 1 and pin3 = 0 then

gosub backturnr

end if

if pin3 = 1 and pin5 = 1 then

gosub backturnspin

end if



This is from a simple bit of code I'm working on for our Robot Building Workshop at MakerFaire. Full code is included in the file attachments.


Added tip: I like to use a small switch to make it easier to change between program and run modes. Otherwise you need to constantly move the little jumper.

(Click the pic for a larger image.)

Comment viewing options

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

You know, I have pretty much made the switch to Arduino (and Propeller for personal stuff) but I think I need to keep playing with the picaxe stuff. These M2's are pretty gosh darn good.

Sure, it is pretty cool we figured out the pin 5 thing, but I was looking at your pictures above and was thinking how handy it is to be able to run off of 2 AA's , 3AA's, 4AA's etc. --No fuse bits, no brownout stuff (unless you want to) and the thing just works. 2-cell battery packs sure open up a lot of posibilities when doing small bots.

Yup, gotta play with these m2's some more...

Oh, and some video too please, if it is not too much to ask!

I've always liked the 08 chip, and the M2 is awesome for super simple robots.

You may have noticed I used one of the SpurtBot kits you sent me as the body for this robot. I've already torn it apart and moved it to another body. I basically just cut two 2 in. x 3 1/4 in. pieces of plexi and foam taped together a robot. I'll post pics and vid separately on a robot page. That will be my test platform for the MakerFaire kits until you develop a prototype.