|
|
View previous topic :: View next topic |
Author |
Message |
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
USB to LPT with a PIC |
Posted: Sat May 13, 2006 10:51 am |
|
|
Has anyone came across any code for creating a usb to lpt? I have a device that operates via RS232 or a parallel port. I am going to use USB in lieu of the RS232 and it would be nice to get rid of the parallel connection as well.
Thanks |
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Sun May 14, 2006 12:30 am |
|
|
I am well aware of USB to parallel converters. Buying something off the shelf is not what I have in mind. Like I said, I have a product that has both a Rs232 and parallel port interface. I am replacing the RS232 with a USB connection. It would be nice to get rid of the parallel port as well and use the same USB connection. |
|
|
Ttelmah Guest
|
|
Posted: Mon May 15, 2006 4:09 am |
|
|
There are quite a lot of 'questions' that apply here.
To do this, you need PC code to provide a 'virtual parallel port' such code is available, but more expensive/harder to find than the ones for virtual serial ports. In the early MS dev kits, there was an example driver to do this.
However you then run into the question of whether the software that talks to the parallel port, uses this as a printer, or as a general purpose I/O device?. If the former, then this can be made to work. If the latter, then it won't work. The reason is that the USB 'layer' means that accesses are serialised, and basically asynchronous. So if (for instance), the host device, sets a pin, and then a few uSec latter sets another pin, these two changes can (with the right driver), be sent over USB to the remote device, but the time interval between them, at the target end, is no longer guaranteed. This is why the proprietary 'USB parallel port' devices, should really be 'renamed' as 'USB _printer port_ devices'. These devices will drive printers, but will not access devices that attempt to do more complex I/O on the port (units like cameras, CNC machines, scanners etc. etc..).
On these latter more complex I/O devices, it is possible to produce a USB interface (in general), but doing so, requires that you shift all the bit timing operations to the USB slave, and in general use a dedicated driver at the PC end, to access this. Hence if your remote device is one that uses the parallel port as a more general purpose I/O device, you will almost certainly not be able to provide a 'reverse compatible' USB printer interface...
Get one of the proprietary units (they are cheap). If your remote device works with it, you then know that it is compatible with the virtual port. If it won't, then you have saved yourself a lot of development time, and can work out how you want to go about this...
Best Wishes |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|