PDA

View Full Version : USB TO Parallel Port DIY Interface



Lee Roberts
11-11-2008, 07:05 PM
FREE USB-Parallel Port Interface
Released 08/03/2006 - Updated 12/03/2006.

Do you drive your Motor Controller usually via the Printer Port?

Well now you can convert it to USB with this very simple Circuit below. We supply the PCB design FREE, the Firmware FREE and the Windows Application FREE

You just build it, use it and let us know of any improvements we can make.

To compliment our new FREE Beta USB Application (Shown Below) along with new Firmware, we are going to release a very simple circuit that people can build themselves that will let you control any parallel port stepper motor controller via USB.

With this simple circuit and our Firmware you will be able to simply plug it into your existing Controller box and using our software, run your Gcode via the USB Port.

The reason this will work with any existing Controller box that uses the parallel port to control the Clock and Signal lines is because we will release standard Firmware that will cover different pin configurations as needed.

Find below the first picture of version 1.0

As you can see, this is not going to cost you a lot of money to make!!!!!!!!!
25572

PCB and Components.

Please find below the PCB layout.
Size of PCB is 75MM * 75MM
25569
25573

Click here to download the Hi Resolution images: 25574

These are 600DPI JPG and need to be viewed and printed in Adobe Photoshop for an exact scale.
Also included are postscript files as well.

We are also releasing the PCB Layout in Gcode for people wanting to mill their own.
25570

Milling PCB below with 0.2mm engraving bit.
25571

Drilling PCB below with 0.8MM drill bit.
25575

Click here to download the Gcodes: 25576

Inside this file are two Gcodes, one for the Milling and the other for the drilling.

Components:
1 * 25pin socket
1 * 18F4550 Chip
1 * 40 pin Dip Socket.
1 * USB Socket
1 * 20mhz Xtal (the Pic internally clocks this upto 48mhz)
2 * 22pf ceramics
1 * 4k7 resistor
1 * 1k resistor
1 * LED
1 * 0.1uf ceramic decoupling cap.
1 * 0.1uf electrolytic capacitor
1 * 22uf electrolytic capacitor
1 * little tactile push switch for resetting Pic, not really needed.

And a PCB about 75mm * 75MM

Firmware Version 1.2 released 12/03/2006:

Click here to download the Firmware Version 1.2 Type1: 25577

This code is for use with the 18F4550 Pic Chip.
You will need a suitable Pic Chip programmer that supports the 18F4550.
The fuses have all been set in the hex file, so simply load up, Program and Verify.
Type 1 is configured for the following Pin Configurat

Pin2: Step X-Axis
Pin3: Direction X-
Pin4: Step Y-Axis
Pin5: Direction Y-Axis
Pin6: Step Z-Axis
Pin7: Direction Z-Axis
Pin10: Z-Limit Switch
Pin11: Emergency-Stop Switch
Pin12: Y-Limit Switch
Pin13: X-Limit Switch

As we have said before, if you need the firmware customised to suit your controller then please email us and we will re-compile and release here.
Command Structure for Firmw
Command Structure Ver 1.2 upwa
Commands are sent 11 bytes at a t

This first byte gets broken down into 8 bits and they do the following:
bit0= X Axis Direction
bit1= Y Axis Direction
bit2= Z Axis Direction
bit3= Travel kind, this is for the firmware to tell it to use different routines for G00 travelling or G01 cutting, 1=Travelling 0=Cutting
If you set this bit to 1 then the firmware will not care about how it gets to this position and it will just clock each Axis until it gets there.
If you set it to 0 then it will move the X and Y axis at even pulses to get to it's destination giving the correct line needed. This option takes more processing time, so speed pauses may have to be adjusted.
bit4= Tells Firmware to ignore limit switches 1=ignore 0=do not ignore
bit5= always 0
bit6= always 0
bit7= always 0

The next 3 bytes control how many pulses you wish to send to the X-Axis.
On our machine 533.333 pulses =1mm so to tell it to travel we first have to round up and break to binary int(533.333)=533

533 binary= 00000000 00000010 00010101

now we get our 3 bytes from this

1st byte 00000000 = 00
2nd byte 00000010 = 02
3rd byte 00010101 = 21

By doing it this way we can send a max 16777215 pulses which = 31457MM (103 feet!) Travel

The next 3 bytes control how many pulses you wish to send to the Y-Axis.
This is the same as the X-Axis
The next 2 bytes control how many pulses you wish to send to the Z-Axis.
Same as the X-Axis but this time only 2 bytes(16bits)
Final 2 bytes is Pulse Width Delay
0050 = Pulse delay in Microseconds for speed.
This will differ depending on the Step Mode that the controller box is set to.
Find some examples below, obviously we round up because we only send 4 digits to the controller.
Eighth Step Timings:
A 2250 Microsecond pause gives 25.4mm or 1 Inch Travel per minute.
A 1125 Microsecond pause gives 50.8mm or 2 Inch Travel per minute.
A 0562.5 Microsecond pause gives 101.6mm or 4 Inch Travel per minute
A 0281.25 Microsecond pause gives 203.2mm or 8 Inch Travel per minute
A 0140.625 Microsecond pause gives 406.4mm or 16 Inch Travel per minute
A 0070.3125 Microsecond pause gives 812.8mm or 32 Inch Travel per minute
A 0035.15625 Microsecond pause gives 1625.6mm or 64 Inch Travel per minute
A 0017.578125 Microsecond pause gives 3251.2mm or 128 Inch Travel per minute

So to work out what pause we needed for say 45IPM we would use 2250/45 which gives us 0050
To work backwards and see what a pause of 50 would get, we would take 2250/50 which would give us 45IPM.
The motors we use on the CNCDuDeZ Frame max out at about 50 Microsecond pause, which gives us a respectable approx 45IPM!

Quarter Step Timings:
A 4500 Microsecond pause gives 25.4mm or 1 Inch Travel per minute.
A 2250 Microsecond pause gives 50.8mm or 2 Inch Travel per minute.
A 1125 Microsecond pause gives 101.6mm or 4 Inch Travel per minute
A 0562.5 Microsecond pause gives 203.2mm or 8 Inch Travel per minute
A 0281.25 Microsecond pause gives 406.4mm or 16 Inch Travel per minute
A 0140.625 Microsecond pause gives 812.8mm or 32 Inch Travel per minute
A 0070.3125 Microsecond pause gives 1625.6mm or 64 Inch Travel per minute
A 0035.15625 Microsecond pause gives 3251.2mm or 128 Inch Travel per minute

Half Step Timings:
A 9000 Microsecond pause gives 25.4mm or 1 Inch Travel per minute.
A 4500 Microsecond pause gives 50.8mm or 2 Inch Travel per minute.
A 2250 Microsecond pause gives 101.6mm or 4 Inch Travel per minute
A 1125 Microsecond pause gives 203.2mm or 8 Inch Travel per minute
A 0562.5 Microsecond pause gives 406.4mm or 16 Inch Travel per minute
A 0281.25 Microsecond pause gives 812.8mm or 32 Inch Travel per minute
A 0140.625 Microsecond pause gives 1625.6mm or 64 Inch Travel per minute
A 0070.3125 Microsecond pause gives 3251.2mm or 128 Inch Travel per minute

Full Step Timings:
Use below full step for speed of 25.4mm or 1 Inch Travel per minute.
A 9000 Microsecond pause gives 50.8mm or 2 Inch Travel per minute.
A 4500 Microsecond pause gives 101.6mm or 4 Inch Travel per minute
A 2250 Microsecond pause gives 203.2mm or 8 Inch Travel per minute
A 1125 Microsecond pause gives 406.4mm or 16 Inch Travel per minute
A 0562.5 Microsecond pause gives 812.8mm or 32 Inch Travel per minute
A 0281.25 Microsecond pause gives 1625.6mm or 64 Inch Travel per minute
A 0140.625 Microsecond pause gives 3251.2mm or 128 Inch Travel per minute

Every time you send a 11byte command you will get 2 bytes back from the controller that will give you in ASCII the answer OK. This is the same whether sending Serial or USB.

You will also get a 2 byte ASCII code sent back for AUX1 inputs which are triggered:
XL X-Axis Limit Reached
YL Y-Axis Limit Reached
ZL Z-Axis Limit Reached
XY X-Axis and Y-Axis Limits Reached
XZ X-Axis and Z-Axis Limits Reached
YZ Y-Axis and Z-Axis Limits Reached
XA X-Axis, Y-Axis and Z-Axis Limits Reached
ES Emergency Stop Activated.

Application:

Please Check the USB-Software link to download our Beta Application: 25578
25579

Setting up and testing:
After you have assembled your new Interface, simply plug in a USB lead and Windows XP will automatically detect the Interface as a USB Hid Device.
You can confirm this by checking in device manager of your machine.
Now connect your Printer Port cable from the Interface to your controller box and you are ready to go.

Run up the software, set up the pulses per MM parameter and try out the Jog.

Please make sure you read the HELP File first.

tribbles
31-07-2009, 11:57 PM
I've done a (very) quick hash at a schematic - with a few revisions:

The PIC to be programmed in-circuit with a PICkit2 or PICkit3. You'll need to make sure your CNC device is unplugged when you do this (since it pings a couple of the pins), and also don't press the switch when you do it!
The >400nF capacitor has been included
The component numbering has been altered


The new layout is smaller, and doesn't have any wire jumpers. However, it is designed primarily for photo-etching (the .zip file contains the PDFs for the schematic, layout and PCB itself, at a 1:1 scale - I use the latter for my photo-etching of boards).

If you want to remain faithful to the original design (i.e. you don't need the ICSP header), then you can replace D1 with a wire, and remove PL1.

If this treads on anyone's toes, please let me know.

farhad1223
25-12-2009, 08:44 PM
hi
i made one cnc router mechine but i can not building driver controler for 3 axies motor steper-please help me for make driver controler (with pc) thank's

tribbles
25-12-2009, 11:14 PM
Do you have the schematics in Eagle PCB format?

irving2008
22-05-2010, 02:07 PM
try www.cncdudez.co.uk (http://www.cncdudez.co.uk) instead, but both links are working

This version is NOT the smoothstepper shown in the video, thats a commercial product with a Mach3 plugin. I don't think there is a Mach3 driver for CNCDudez' interface

Robin Hewitt
07-06-2010, 12:12 PM
Does the computer make the "dee-dum" noise when you plug it in/unplug it? If not, you have not got a working USB interface.

As it is HID rather than Generic Serial, did it ask for the .inf file location when you first plugged it in?

Robin Hewitt
09-06-2010, 09:56 AM
If any USB device makes the noise, they all will.

The computer finds a USB device and gets it's unique product ID number. Then it goes "dee-dum" and looks for software matching that number.

No noise means there is a problem in the firmware or the hardware.

Product ID numbers are a problem if you want to make USB devices. The numbers are free but you have to join the USB club to get them which costs about £3k IIRC. When I needed numbers I searched the web and found a USB club member wanting to sell me ten numbers for a hundred pounds or so which is how I got around it. Wonder what number you are using.

irving2008
09-06-2010, 10:34 AM
The USB device ID is a combination of device, interface and endpoint configurators. These are set by firmware after the PIC is reset and then the sequence is:


When the device is initially attached to the bus, the host
enters an enumeration process in an attempt to identify
the device. Essentially, the host interrogates the device,
gathering information such as power consumption, data
rates and sizes, protocol and other descriptive
information; descriptors contain this information. A
typical enumeration process would be as follows:
1. USB Reset: Reset the device. Thus, the device
is not configured and does not have an address
(address 0).
2. Get Device Descriptor: The host requests a
small portion of the device descriptor.
3. USB Reset: Reset the device again.
4. Set Address: The host assigns an address to the
device. >> this is where the de dum sound occurs
5. Get Device Descriptor: The host retrieves the
device descriptor, gathering info such as
manufacturer, type of device, maximum control
packet size.
6. Get configuration descriptors.
7. Get any other descriptors. >>during 5,6,7 Windows refines its understanding of the device, this is where you'll see 'Found generic HID' followed by 'Found <some device class>'
8. Set a configuration. >>this is where windows tries to load the required software

Since the ProductID is expensive the specifics are often in the later configurators, using a generic ProductID at the top level.

If you are unable to get Windows to recognise the USB device, you could try downloading a USB diagnostic tool (http://www.softsea.com/review/USB-Monitor.html). Does the device appear in Device Manager as an 'Unknown device' with a yellow question mark? If so then Windows is not recognising the descriptor as one of the generic classes. If it doesnt appear at all then the USB controller isnt able to do the initial reset/enumeration (steps 1 - 3 above) and Windows will never know the device exists. If this is the case then the problem is in your hardware or software (including the Microchip USB libraries) and without a full scale debugger and source code and the knowledge to use it there is little anyone can do to help.

Robin Hewitt
09-06-2010, 02:58 PM
I just had a quick look on www.usb.org (http://www.usb.org) and it seems you can now get vendor ID numbers for a mere $2k.

Not as bad as I remembered it but they've now added a clause to say you can't sell numbers on. Too late guys :naughty:

tribbles
11-06-2010, 11:39 PM
If you're using a Microchip product (which this is), then you can apply for a PID and use their VID - although if usb.org has changed their rules, then I don't know if it's still applicable (I did download their application form a week ago though, so it's not been removed - but then I did find a direct link to it off another website, and they may have not removed it; only their links to it).

Robin Hewitt
11-06-2010, 11:57 PM
usb.org
Click "Developers"
Click "two option" link in "Getting a vendor ID"
Click the third of the two options, ""vendor ID" no logo licence
Gets you here...
http://www.usb.org/developers/vendor/VID_Only_Form_withCCAuth_02042009.pdf

First paragraph includes the restriction

Paragraph 2, the admin fee, results in the Yorksire War Cry...

'Ow much? :eek:

ronmalfred123
27-12-2010, 09:27 PM
please help me.. i have been working on pic18f4550 for making a usb to parallel port ,,, i saw a hope after looking this thread...

due to cost reasons i can stick to pic18f4550 only...

the firmware and software links are dead please update ,,some one help :( :( !!!!!
:eek:...
there are some more doubts regarding this thread,after i program the micro controller and make all driver loading will my computer will detect it as LPT ? (as printer port in device manager like that of desktop systems)if know that how will be able to access the DB29 port?

:( :( i am in an urgent need of help... i will be very thank ful; :)

rony

irving2008
27-12-2010, 10:28 PM
please help me.. i have been working on pic18f4550 for making a usb to parallel port ,,, i saw a hope after looking this thread...

due to cost reasons i can stick to pic18f4550 only...

the firmware and software links are dead please update ,,some one help :( :( !!!!!
:eek:...
there are some more doubts regarding this thread,after i program the micro controller and make all driver loading will my computer will detect it as LPT ? (as printer port in device manager like that of desktop systems)if know that how will be able to access the DB29 port?

:( :( i am in an urgent need of help... i will be very thank ful; :)

rony

I am afraid CNCDudeZ website is down and hasnt been updated for a while. You could try PM'ing CLaNZeR (http://www.mycncuk.com/forums/member.php/746-CLaNZeR)(CNCDudeZ) direct but he's not been around for a while and I don't think he supports this project any more.

Moderators

irving2008
27-12-2010, 11:43 PM
Hi welcome back Sean... Google was reporting the .co.uk site as off the air earlier today when i tried it...said their last cache was the 14th December..

Swarfing
28-12-2010, 10:31 AM
Hey welcome back Sean and when you popin in for this cup of tea on the way through Swindon?

Paul

irving2008
28-12-2010, 10:48 AM
Have spent the holiday working on the Caliper Hack as I notice a few guys have been playing with it also on another thread.
I hope to use it for PWM on solenoids driving a X'Y table using air pistons and hope to get it pretty precise.

Which thread is that Sean?

irving2008
28-12-2010, 11:31 PM
http://www.mycncuk.com/showthread.php/1879-Cheap-Idea-for-a-DRO/page7Yes, i saw... :smile:

Swarfing
29-12-2010, 04:58 PM
No worries Sean good to hear you still about.

madflyer
12-01-2011, 12:54 AM
Hello Lee,
i'm currently working on a software that should control 4 motors for a wire machine using our software, see the software here

http://www.youtube.com/watch?v=WzB3aYCwk8g
we really would like to sell the software with a dedicated hardware for controlling the 4 stepper and the question is
if your development could be used as a starting point for this and how much it would cost.
As you can see, we need 4 motor axis direction control, and we could use some others i/o for heating the wire and limit control.
if you have interest in this project please contact me at [email protected]
Thank you for your time

JAVIER
04-04-2011, 07:45 PM
In the first place happiness for their project. I am a student that I would like to carry out this badge USB. The problem is that my parallel port is different and therefore I cannot make it. My parallel port is the following one:

Pin1 X Step
Pin2 Y Enable
Pin3 Y Dir
Pin4 Z Dir
Pin5 Z Step
Pin6 Z Enable
Pin7 X Dir
Pin8 Y Step
Pin9 spindle MOTOR
Pin10 X Home
Pin11 Y HOME
Pin12 Z HOME
Pin13 EStop
Pin14 X ENABLE
Pin15 EXPAND
Pin16 EXPAND
Pin17 EXPAND
Pin18 to Pin25 GND

The Firmware could send me for the PIC 18F4550.

THANK YOU

pavlo
06-04-2011, 09:10 PM
surely it would be easier to make a custom parallel cable to correct the pinouts rather than rewrite the code?

sale030
17-04-2011, 01:54 PM
Hello to everybody.
I have one problem with my USB to PARALLEL Port DIY Interface. It's recognized correct on PC with Win XP but when I connect it to my laptop with Win 7/32 device has not recognized (Unknow device) as well as I connect it to my desktop PC with Win 7/64. Any sugestions?

medet
18-09-2011, 12:09 PM
hello. can ı use thıs project with match3

ComputerENGg
25-01-2012, 03:10 PM
Hello Sir.

sir im having trouble, which program do i need to use to control the leds? I have 8 LEDS in my project. I know how to control them using 8 PINS of the Parallel port and also using the Assembly language to create sequence of each LEDS/PINS., but what i want is, i want to control them using USB. Is this module that you have created can possibly control the LEDs?
I need your help sir. :(

Thanks a lot...
GodBless.

pascalbianca
26-06-2012, 11:14 AM
Where can i download this beta from this thread?
http://www.mycncuk.com/forums/showthread.php/435-USB-TO-Parallel-Port-DIY-Interface?p=1797&viewfull=1#post1797

The link of the download is dead.
Thanks for the help.

lkanta
07-08-2012, 10:24 AM
I did not see any connection of 5V and ground connection into the pcb design..
But in the schematic there is 5V and ground connection,
Any one please help me...

irving2008
07-08-2012, 12:44 PM
I did not see any connection of 5V and ground connection into the pcb design..
But in the schematic there is 5V and ground connection,
Any one please help me...


see here: bottom two connections on right hand set of connectors.

sacra
13-03-2013, 10:01 PM
Hi
I need to convert this parallel board to USB but the firmware codes aren't suitable for it. Each pin of the parallel port goes through a Fet directly to the a coil of a motor. It controls 2 unipolar stepper motors. As you say if one needs a diferent firmware you could change it and post it here, I kindly ask you to do so.I attach the board for your reference . Thanks
8452

markitosb
06-04-2013, 01:32 PM
hello good interface such a query to format or convert to gcode ga
I use vcarve 6.0 and then convert it from the software but it is frozen or has a special software to convert your answer gcode grasias por peru greetings

mkydj
17-10-2013, 06:40 PM
you can customize for Mach3?:nonchalance:

chedenial
14-10-2014, 03:59 AM
Hello to everybody, i am new on this and i have the following pins configuration on a 4 axis cnc (DB25) :

2 X step
3 X dir
4 Y step
5 Y dir
6 Z step
7 Z dir
8 A step
9 A dir
10 limit X
11 limit y
12 limit Z
13 home
14 rele out
15 E Stop
16 rele out
17 rele out

How can i do change the firmware ?
Thanks
(Sorry , i have bad english)

a19971828
25-07-2016, 07:13 AM
Hi Lee Roberts , i am interesting in this interface , I am from Peru , How can i talk whith you? ...or what is your email , how can i write you ? ...i am interested in the pic project , the firmware , i want see the firmware project , the ansi c code's firmware to understand it and can make changes , please i will wait your response.

magicniner
25-07-2016, 11:27 AM
Hi Lee Roberts , i am interesting in this interface , I am from Peru , How can i talk whith you? ...or what is your email , how can i write you ? ...i am interested in the pic project , the firmware , i want see the firmware project , the ansi c code's firmware to understand it and can make changes , please i will wait your response.

The links in this thread are what's available, the designer's site is now dead and the product appears to be an orphan,
Regards,
Nick

Dragoblaztr
16-09-2016, 12:12 AM
It's possible to use this adapter with software mach3 without using plugins?

Regards

magicniner
16-09-2016, 09:59 AM
It's possible to use this adapter with software mach3 without using plugins?

Regards

In short, no.
If the designers had developed a plugin for Mach3 this would have sold like hot cakes ;-)

- Nick

arnol
04-11-2016, 09:38 PM
Can anybody advise if this sub to parallel port interface will work with windows 7??

media1328
15-02-2018, 04:10 PM
Hi Mr. Lee so much thanks for such a good project. and sorry for my poor English. few days ago I found your blog and also found the project that I was looking for. but unfortunately the code is missing here can't download it. it shows it is zip file but I can't download it so will you please send me that file if possible. your job will be appreciated. hardly I need that.
again so much thanks and best regards.

media1328
15-02-2018, 04:22 PM
sorry came back again I mean this file:

Click here to download the (Firmware Version 1.2 Type1)

magicniner
15-02-2018, 08:19 PM
Once more with Feeling!


The links in this thread are what's available, the designer's site is now dead and the product appears to be an orphan,
Regards,
Nick

m_c
16-02-2018, 12:44 AM
Once more with Feeling!

But do you know where to get a copy of the firmware? :joker:

magicniner
16-02-2018, 12:27 PM
Try searching the WayBack Machine archive for the original website

http://archive.org/web/

magicniner
16-02-2018, 01:12 PM
But do you know where to get a copy of the firmware? :joker:

Yes! ;-)
Here Ya Go! -

https://web.archive.org/web/20160313073440/http://www.overunity.org.uk/cncdudez/USB-PAR-FirmwareV12-type1.zip

media1328
17-02-2018, 07:46 PM
All bests for you thanks too much