Interface circuit - Device 7 in manual Bipolar stepper - Syntax error

huttonart

New Member
I am trying to copy word for word the sample procedure on page 17 of the PICAXE interfacing circuits manual - to control a bipolar stepper motor using L293D chip. I'm using an 08M PIC.

When I check the syntax it comes up with an error for two lines
line 8:
goto step ( seems odd since it is a commancd clearly accepted by the 08m)

line10:
step: let b1 = b1 & 2

Any idea what the problem is?

many thanks

Steve
 

westaust55

Moderator
another manual error that will eventually be fixed sometime in the future.

the thread referenced is dated: 04-04-2003, 01:45
yet still exists in verson 4.2 printed May 2004 = a year later


EDIT:
A recommendation was made recently for a specific section (like code snippets) for logging manual errors
I support this idea. All can then look in one place for errors - well those who use SEARCH
 
Last edited:

huttonart

New Member
Thanks for directing me to that early thread. That’s fixed the syntax problem.

I’m wondering if some kind soul could help me a bit more. I’m an artist and I’ve taught myself enough electronics to get by – relays, servos, hacking into toys etc. And I’ feel confident with the stepper circuit. But the stepper programming coding is bit baffling. I understand the necessary sequencing of pulses. I’ve studied the PICAXE basic manual ( sec 2) but it hasn’t helped me figure out how the sample of code in the interface section actually works.

First off – Is it possible to use a 08M? I want to use pins 0,12,4 because pin 3 is input only – which I need to use for input. And I realise pin 0 has to be jumped after programme downloading.

Then my question is about the line that reads :
Lookup b1,(%1010,%1001,%0101,%0110),b2
Let pins +b2

Now this might be stupid but because % indicates binary I’m thinking that the line reads:
Lookupb1, (10,9,7,6),b2 - which seems to get me nowhere?

Or is it that %1010 means pin 0=low, pin 1=high, pin 2=low, pin1=high? And that the sequence of %s is the sequence of steps as in the matrix x in the manual ( which makes more sense to me - but then the manual is referring to pins 4, 5, 6, 7 in the diagram – so that sort of doesn’t make sense)

Then the thread mentions putting a 10ms pause between steps which also make sense. But where in the code would I do that?

I don’t want to do anything very fancy - One whole revolution one way and then back would be fine to get me going.

Nb if an 08m isn’t suitable I’m happy to get another chip.

Thanks to anyone who can help out.
 

Mycroft2152

Senior Member
Welcome to the forum!

Driving a stepper motor with a PICAXE is relatively simple. You will need a PICAXE with four outputs, a 14M or larger.

The problems arise when you try to drive a stepper motor that is too big (needs more current) than the PICAXE can provide. The PICAXE can provode about 20 milliamps per pin, just enough for a very small stepper.

At that point you will need to add a drive circuit and make sure you power supply is large enough.

A little more info and details would help.

What is your art project?

Myc
 

eclectic

Moderator
Steve.
I think I see where the confusion lies.

The program on page 17 of Manual 3 refers to the Picaxe 18 pinout.

As a starter, print out the “Pinouts” for the 08M and the 18X

They're in Manual 1, pages 22 and 25.

The general convention on the forum is

the metal terminals are “legs”
the internal connections are “pins”

also, please read
Manual 2, pages 95 and 96 Let dirs and Let pins

and the “outpins” command.

e
 
Top