In my Graduation project I need to send data from computer to microcontroller to control the position of a stepper motor

Most of the examples I have seen use the legacy parallel port. unfortunately parallel port is not available anymore.

My Question is what are the alternatives that available nowadays and compare between them from the following perspectives: hardware needed, complexity, ability to use with C++ and PIC microcontroller.

I am Using C++, Windows 7, PIC microcontroller.

If you point me to any reference I will appreciate it very much

  • 5
    \$\begingroup\$ What research have you done so far? If this is a graduate project you will need to do some work of your own! \$\endgroup\$
    – David
    Mar 2, 2014 at 16:20

2 Answers 2


The easiest way is to use a serial port (or a USB to serial adapter) and use the UART module on the micro-controller. You should send high level commands (step direction, speed, number of steps, etc) for the PIC micro-controller to interpret, the PIC generates the waveforms for your h-bridges to control the motor(s). This is different than projects which use the parallel port, as the parallel port is typically used to generate the waveforms directly.

A good source for stepper motor control is to look at the hobbyist 3D printer and CAM (Computer Aided Manufacturing) communities (laser cutters, mills, etc). Here is a common h-bridge design used for driving stepper motors: Pololu Stepper Driver. Here is the electronics used to interface several of the drivers with an Arduino (which is fairly straightforward to adapt to a PIC circuit): Arduino Driver Board.


You have several options. The three most popular options for connecting hardware to a computer are

1) Physical USB connection

2) 802.11 wireless connection

3) Bluetooth wireless connection

You can buy PIC microcontrollers which already have a USB communication port on the chip.

If you want to go the wireless route, there are several prepackaged (antenna and all) wireless modules you can buy. They can communicate with the microcontroller through several means, SPI, I2C, UART, etc.

As it is your graduate final project, how complicated it has to be will likely be up to your supervisor and the focus of your project. For example, if the focus of the project is communication between the microcontroller and a computer, I would envision that the project would be organized as to require it to display a deep understanding of some communication protocol, such as USB, and easy-to-interface off the shelf parts frowned upon. On the other hand, if the main focus is stepper motors and not communications then using off the shelf parts for USB communication would probably not be frowned upon.

  • \$\begingroup\$ Good answer, but I would differentiate Physical USB Connection between actual USB protocol on the MCU and use of an external USB-to-Serial (Or USB to whatever protocol) connection. \$\endgroup\$
    – Passerby
    Mar 2, 2014 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.