EmbeddedRelated.com
Forums

USB to Parallel port

Started by Unknown June 2, 2008
On Tue, 03 Jun 2008 04:11:20 +0000, Doug McIntyre wrote:

> =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= <toe@lavabit.com> writes: >>> This has been around for years, August 12,1981 to be >>> exact.http://en.wikip= >>edia.org/wiki/IBM_PC
There were "Centronics" parallel printer ports before the IBM_PC, although I think that the PC was probably the first to pervert the DB25 connector to the purpose. Previously the centronics style connector was at both ends of the cable.
>>Still I don't see how a 25-pin plug can become a 9-pin plug? What >>happens to the extra signals on the 16 dead pins?
It's possible to run a serial terminal with three wires, if you use x-on/ x-off flow control. These still (typically) use DB25 connectors, though.
>>If there's no signals on these pins to begin with, then why does the >>advice use a DB25 instead of a DE9 in the first place?
That's what the RS-232-D spec said to use. [Snip a bunch of good stuff. Just one nit to pick:]
> Since RS-232 only used 9 pins anyway, it fit just right on it. The other > 16 pins go unused, and aren't connected to anything anyway.
"Proper" modem and terminal control really needed at least ten pins: you don't get the full set on a DB9 and have to fake one of them. I can't remember off the top of my head which one, but it was something like RTS. Most of this started to be less important soon after the DB9 came into use, as modems were getting a lot of milage from things like AT command sets and other innovations. Regarding the OP: you can, indeed, get a "real" USB-to-parallel port (in the programmable bi-directional latch with handshaking sense) at the chip level, but I don't know of any actual products for sale that let you play with that. Or rather, that's very probably what the various parallel printer USB connectors give you, *but* they can't fake the very low, register-level programming interface that has always been used to talk to the traditional 8255 printer interface on PCs. Since they can't fake the API that bit bashers' want, they provide a high-level "Printer" driver, and don't disclose the information that would allow you to frob the bits yourself. USB serial ports can't fake the low-level interface either, but that's less of an issue, because it's generally OK to use the device- driver-level API to talk to a serial port. Cheers, -- Andrew
On Jun 3, 5:27=A0am, Andrew Reilly <andrew-newsp...@areilly.bpc-
users.org> wrote:
> "Proper" modem and terminal control really needed at least ten pins: you > don't get the full set on a DB9 and have to fake one of them. =A0I can't > remember off the top of my head which one, but it was something like > RTS. =A0Most of this started to be less important soon after the DB9 came > into use, as modems were getting a lot of milage from things like AT > command sets and other innovations.
It's the second (frame) ground that's missing. For async, none of the other signals are particularly interesting. On RJ-45s (specially EIA-561), DSR is missing (as there are only eight pins).
On 3 Jun, 04:01, Tom=E1s =D3 h=C9ilidhe <t...@lavabit.com> wrote:
> > Still I don't see how a 25-pin plug can become a 9-pin plug? > > What happens to the extra signals on the 16 dead pins?
Nothing. They don't go anywhere. A few are completely unused and the others control things such as the secondary channel that are almost never used. They aren't implemented on most devices even with the DB25 connector - this goes for PCs with 25 pin serial ports. BTW the connector conspiracy is more complicated than you seem to envisage. DB25 ports can be used for other serial standards or completely different protocols - Apple used them for SCSI which wasn't such a good idea (the connectors aren't really suited to SCSI speeds). For RS232 on DB25 the convention is for DTE wired devices to have male connectors and DCE devices to have female, but again this is flexible - some manufacturers, e.g. Sun used female connectors on DTE machines with the rationale being that they are less likely to be damaged than male connectors.
> If there's no signals on these pins to begin with, then why does the > advice use a DB25 instead of a DE9 in the first place?
Primarily for legacy reasons. However using connectors with more pins than required is actually quite common. The 6 pin PS/2 keyboard and mouse connectors only use 4 pins for instance. That one really is oddball because they could have just as easily made a combined keyboard-or-mouse port by putting the signals for one device on the unused pins (in the same way laptops do) and saved the hassle of plugging each device into its correct port when the machine is against the wall and you can't see what you're doing...
> Why do you say that the answer is no? USB is a hell of a lot faster > than even the most advanced parallel port (IEEE 1284), so it seems to > me that this can be done perfectly if you have: > > =A0 =A0 * A microcontroller inside the adapter that does the job of > converting USB signals to parallel port signals > =A0 =A0 * A device driver for the PC which fools the computer into > thinking it has a fully-fledged parallel port
Others have mentioned the latency involved but the driver is also tricky for the general case. Some device use I/O ports in ways that were never envisaged in the original design, using low-level bit banging of individual signals to create the desired effect. This is usually acomplished by dealing with the hardware directly - it isn't as simple as wishing up a new driver. While simple stuff like a printer will usually work fine with a USB parallel port things like Zip drives and scanners may not. Some circuits are even more dependent on this low level control - the minimalist parallel port PIC programmers will not work at all for instance. -- Andrew Smallshaw andrews@sdf.lonestar.org
In article <u60a44pon6pga3r4mjfbj33m19b5r3c629@4ax.com>, keinanen@sci.fi=20
says...
> On Mon, 2 Jun 2008 19:18:18 -0700 (PDT), Tom=E1s =D3 h=C9ilidhe > <toe@lavabit.com> wrote: >=20 > > > >OK so here's what I understand so far: > > > >* DB25 is nothing more than a connector, it can be used with different > >kinds of transmission protocol >=20 > True >=20 > >* Serial ports use the RS232 protocol >=20 > Most serial ports use RS-232, but others might use RS-422/485 > (balanced), RS-423 (unbalanced) or 20 mA current loop. >=20 > >* Parallel ports use the IEEE 1284 protocol >=20 > i.e 5 V TTL > > > >Serial ports have a DE9, and parallel ports have a DB25. >=20 > At least the RS-232C standard did not specify the connector and I am > not aware that some later revisions did that.
Quite a few years ago RS-232D tried to start doing that, but I beleive=20 most of it was advisory. The pre-dominace of DB25 on modems and serial came from the use of modems and PTT standards, hence CCITT (now ITU). --=20 Paul Carpenter | paul@pcserviceselectronics.co.uk <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.pcserviceselectronics.co.uk/fonts/> Timing Diagram Font <http://www.gnuh8.org.uk/> GNU H8 - compiler & Renesas H8/H8S/H8 Tiny <http://www.badweb.org.uk/> For those web sites you hate
On Jun 2, 11:01 pm, Tom=E1s =D3 h=C9ilidhe <t...@lavabit.com> wrote:

> Still I don't see how a 25-pin plug can become a 9-pin plug?
When applied to a serial channel, far fewer than 25 pins are needed. Often only 3 are used, or sometimes 5. A 9 pin connector is adequate to carry that. The 9-to-25 adapaters connect the signals that are conventionally used in serial applications, and leave the rest unconnected. In the old days, before the IBM PC, serial ports were on 25 pin connectors (and often female on the computer side), and parallel ports were on centronics connectors, as the printer end of a printer cable often still is. IBM started a bit of a new connector scheme, which became a defacto standard itself, but the original standards remained too.
> Why do you say that the answer is no? USB is a hell of a lot faster > than even the most advanced parallel port (IEEE 1284), so it seems to > me that this can be done perfectly if you have:
USB is both faster and slower than a traditional parallel port. It's faster in the sense that it's designed to let you shove more data down it per unit time - it has high "throughput". But it's also slower, in that it takes substantially longer to set up a data transfer - it has substantial "latency". So USB is terrible for some classic parallel port hacks, like controlling motors on hobby-scale comptuerized machine tools, and also for applications that involve rapid back-and- forth "conversations" of very short messages betweeen device, which includes some kinds of programmers for embedded devices. Sometimes you can get around this by moving the "device interactive" part of the program from the host PC into a micro controller sitting on the other side of the USB, and have the PC give it higher-level work orders. USB to parallel adapters exist, but generally they only work well for what they were designed to do: talk to printers. They tend to be either slow, or completely unworkable with many of ht other gizmos that have been designed to hang off a PC parallel port over the last 18 years.
Op Tue, 03 Jun 2008 13:06:49 +0200 schreef Andrew  
<andrews@sdf.lonestar.org>:
> On 3 Jun, 04:01, Tom&#4294967295;s &#4294967295; h&#4294967295;ilidhe <t...@lavabit.com> wrote: > [...] using connectors with more pins > than required is actually quite common. The 6 pin PS/2 keyboard and > mouse connectors only use 4 pins for instance. That one really is > oddball because they could have just as easily made a combined > keyboard-or-mouse port by putting the signals for one device on the > unused pins (in the same way laptops do) and saved the hassle of > plugging each device into its correct port when the machine is against > the wall and you can't see what you're doing...
Some laptops had a PS/2 "keyboard-or-mouse" port. The electrical interface is exactly the same, but the command set is slightly different, so I guess that is used to detect which is connected. -- Gemaakt met Opera's revolutionaire e-mailprogramma: http://www.opera.com/mail/