Picaxe 28x1 and a bipolar stepper motor

Hello again!
Flush with the success form my first posting I have another query I’d appreciate some advice on.
Again it involves a Picaxe 28x1 this time in conjunction with a L293D motor driver to control a bipolar stepper motor. The ultimate aim is to drive a turntable on my model railway. I first set everything up on a 28 pin project board, adding the 4 pins for the motor connection, and with a 12v supply for the motor. Using the example code as in section 3 of the Picaxe manual, I could not get the motor to run. I even wired the circuit up on a breadboard, but still no joy. On one of the forum postings I came across a modified form of the code to that shown in the manual and tried that, but still the motor would not operate. So my query is – is this code only suitable for earlier versions of a 28pin Picaxe and do I need to modify it to suit a Picaxe 28x1? If not, any other suggestions to what might be the problem?
The motor I’m using is a bipolar stepper motor, 6v to 25v with a 17v base line rated at 5w. The code I'm using is as shown below.

Main:
for w5 = 0 to 9
let b1 = b1 + 1
gosub step1

next w5

for w6 = 0 to 9
let b1 = b1 - 1
gosub step1
next w6
goto main

step1:
let b1 = b1 & %00000011
lookup b1,(%00001010,%00001001,%00000101,%00000110),b2
let pins = b2
Return
 

Technical

Technical Support
Staff member
Sounds like you are using the AXE020 project board, where the L293D is on outputs 4-7 not 0-3.

If so the lookup line becomes something like this:
lookup b1,(%10100000,%10010000,%01010000,%01100000),b2
 
Top