Stepper Motor Control via Parallel Printer Port under Linux


Stepper Driver Card Stepper Motor and Driver Card

The german electronic parts distributor Pollin sells a cheap Stepper motor driver card based on a L298 driver IC from STMicroelectronics. That card has a DB9 connector which can be connected with a 1:1 cable to a PC's parallel printer port.

Here you can find the Source code of a test program which controls the state of the parallel port's data lines under Linux. The program generates the sequences for full and half stepping and can also output any custom sequence to the printer port's data lines.

Compile parport_bb.c with the command line:
gcc -Wall -O2 -o ppbb parport_bb.c
and run it like this:
./ppbb --help
to see a list of it's options.

Here an example of a program invocation:
./ppbb -p /dev/parport0 -H -l 1000 -r -c 10 -R

Don't forget o load the ppdev module:
modprobe ppdev
(as root).

line
Visitors since 2006-07-04: counter last updated: 2006-08-28
line
This site maintained by:
lukas.zimmermann@unibas.ch
My public PGP key
HOME Valid CSS! Valid XHTML 1.0 Strict