CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

USB to LPT with a PIC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

USB to LPT with a PIC
PostPosted: Sat May 13, 2006 10:51 am     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

microcontrollerless
PostPosted: Sat May 13, 2006 5:34 pm     Reply with quote

You could buy a USB-to-parallel adaptor such as this one. http://www.cdw.com/shop/products/default.aspx?edc=742268

You could try a one of the FTDI's USB-to-parallel chips, like FT245R.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sun May 14, 2006 12:30 am     Reply with quote

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







PostPosted: Mon May 15, 2006 4:09 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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