Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Control Stepper Motor Through PC Serial Port

Status
Not open for further replies.

buchacho

New Member
I have searched the web, but haven't found anything too promising on controlling a stepper motor through a PC serial port without a microcontroller. Could someone point me to plans, schematics, components, strategy or anything that could help in interfacing a stepper motor to the RS-232 serial port? Using a parallel port is not an option with the hardware I have. Thanks!
 
You could use a standalone UART to covert from serial to parallel, assuming you could find the ancient parts required?. Is this a class project that bans micro-controllers?, because using one would make it a trivial project using easily available components - and also make it FAR more versatile.
 
Adding glue logic to the receive pin on the driving device would solve your problem, such as a clock decoder and a shift register. You could probably do it with a couple flip flops and a serial in parrallel out shift register. No error corerction mind you. The problem with this is that the number of chips you'd have to add to do that standalone could be replaced by a single smaller micro controller... If you can figure out how to setup the decoding logic you're probably smart enough to program a micro so ...?
 
To back-up one step, I would like to control a stepper motor with an embedded Linux box through the serial port. What sort of micro controller could I use that will accept commands to the serial port through simple scripts? I would prefer building my own circuit instead of buying a kit. I'm a newbie in this area, so any help is appreciated.
 
These should be of some help...

CDP68HC68P1 - CMOS Serial 8-Bit Input/Output Port

and a nice little circuit dragged from the web using a 74HC299
 

Attachments

  • serial.pdf
    81.4 KB · Views: 1,394
  • sp port.gif
    sp port.gif
    9.8 KB · Views: 1,385
The Mad Professor said:
These should be of some help...

CDP68HC68P1 - CMOS Serial 8-Bit Input/Output Port

and a nice little circuit dragged from the web using a 74HC299

Thanks for the information! I have seen a few web pages that use the parallel port to easily control a stepper motor, so if I use the CDP68HC68P1, can I essentially send serialized parallel commands to the serial port, and it will do the serial/parallel conversion for me?
 
You send the command word/ data byte just as you would if you were using the parallel port, the computer understands how the serial port works and for the want of a better description.. it turns the data sideways.

The ever usefull (and free) quickbasic software looks something like this.
OPEN "com1:9600,n,8,1,,,,RS" FOR OUTPUT AS #1 [this opens the serial port for output]
OUTPUT #1, motorcommad [ sends the data to the port]

Sadly there is no OPEN COM statement in Visual Basic and instead you need to use the MSComm ActiveX control to do serial I/O or write more complex code using the Windows API.
 
I looked into the 74HC299 and found the article with the schematic that you (Mad Prof.) mentioned:

**broken link removed**

The article says that a clock signal would need to be generated, and it gives a sample program. If I were to use quickbasic to at least test out the circuit, would I also need to to generate a clock signal, or would that aspect be taken care of?

I also looked into the CDP68HC68P1, but I couldn't figure out how it would work with an RS232 port. It does mention being SPI compatible.
 
Yes you will need to create that clock signal, translating the "C" program into some form of basic will give you a better idea of the sequence of events that takes place.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top