320volt / Electronics Projects/

PIC18F4550 Control stepping motor via USB interface delphi

Electronics Projects, PIC18F4550 Control stepping motor via USB interface delphi article "microchip projects, microcontroller projects, " tagged with


This is an example that demonstration how to control some devices via USB interface.The PC software program with delphi.

Feature :
– CPU PIC18F4550 with full speed USB interface at 48MHz.
– USB 2.0 compliance
– Use on-chip USB driver
– Control 1 stepping motor.
– MPLAB C18 for firmware at USB devices side.
– Delphi 6 for PC Host software.

USB devices side

Figure 1. is the schematic for this example.PIC18F4550 is the main devices that communicate with PC and control stepping motor. The power supply came from +5V Vbus for circuit except +Vmotor which must use external power supply that depend on stepping motor requires. If you add more components into circuit that drawn total current more than 250mA you should be use +5V external power supply instead Vbus.Becuase Vbus can supplies current not more than 250mA and don’t forgot to disconnect Vbus out of circuit.

Don’t connect +Vmotor to Vbus.

In this example I drive the stepping motor with 1-phase drive method(A-C-B-D).You may be change for your appropriate application.

PIC18F4550 Control Firmware

The firmware for this example program with MPLAB C18 with USB driver from Microchip. If you need to change or add new command please look at file user.c and use.h in user folder.

stepping motor PC software side

This example program with delphi 6 which modified from C++ wrote by Microchip staff. I have modified the original source code for 3 command for this example : turn left,turn right,Stop motor and connect.For detail of C++ example see in PICDEM™ FS USB User’s Guide and relate files.

PIC18F4550 Control stepping motor via USB interface delphi step motor program

The USB driver which use for this project is the Microchip General Purpose USB Windows driver which programming with C/C++ .If you need to program your own USB driver look at this website which have more interest USB driver programming information (www.jungo.com). But, programming USB driver is so hard works.Also,you need to know how dose the OS work.

for more infomation about USB please go to :

Source http://www.sixca.com/ – Usb Step Motor control circuit alternative link: pic18f4550-control-stepping-motor-via-usb-interface-delphi.rar

  1. Electronics Circuits