usb-parallel adapter for I/O

I have spent a few days hacking on a usb-parallel adapter based on a Prolific pl2305 chip trying to get a bit-bang 8 bit output device for linux... I'm very very close but I'm stuck. Its turned into more of a puzzle than it has a useful exercise but I'm determined to get it working.

Here is what I have figured out about the adapter. Its only made to talk with printers so it requires handshaking. When you hook it up to the USB port, it shows up as /dev/usblp0. echoing a character to / dev/usblp0 always displays '00010000' on D7-D0 respectively.. thats a DLE(data link escape character).. some research told me that this is the token marking the beginning of the stream. A little reading and toying around and I found that once I get the DLE, if I ground [ACK] and [BUSY] my data will appear on D0-D7... bingo... but once I get my data I'm stuck and can't send any more data.. which is ok... I tried permanently grounding [ACK] and [BUSY] but it just freezes the adapter on init.. this thing is gonna take a real circuit

So first I found/hacked a small program to send a soft reset to the device... this resets my data lines when they are set... works like a charm

Circuit #1 -- first success There seems to be suffucient internal current limiting in the device to protect everything... I just need a way to momentarily ground [ACK] and [BUSY]. I used a 2n3904 transistor with base tied to [D4] (only high bit in DLE)... [ACK] and [BUSY] tied to collector, and ground tied to emitter... reset became ineffective and I could not connect to the USB port with the transistor installed... but once the hardware was past init and reset I could install the transistor and send a byte... and then bingo... my data appeared on the data lines.

circuit #2 - first working circuit I figured that maybe someplace in init and reset there was a momentary state that tested the status lines or something and my transistor was screwing this up... I needed a delay to get past this. so I left the emitter and collector parts of my last circuit alone and modified the base... I put a 1M ohm resistor in series with the base and a 100uf cap from base to ground... it worked... but the trigger was looong with that huge RC value and I got alot of inconsistent behavior with the reset. so I started shrinking the C value until the device didn't work... 10uf was the lowest I could go and this put my delay under a second This is a buggy but useful circut for turning on lamps or fans or something... but not for anything useful. I want more...

Circuit #3 - major improvement.. but still way too slow Someone suggested that the data lines might not be going under .7v so I should put a diode in series with the base... so I did... in fact I put 2... cleaned up all of my inconsistent reset problems.... so I started lowering the resistor value until the circuit stopped working... well... i completely removed the resistor and the circuit still works... and you can still see DLE flash momentarily before the data arrives(I have LED's on the data lines)... my delay doesn't seem to want to go away... I want this to go much faster... I tried lowering the cap value but it won't go any lower without causing problems with init and reset.

so... does anyone have any idea what I can do to speed up the circuit and still have it work?

Reply to
Chris Johnson
Loading thread data ...

I think one of the first things I would do, would be to get rid of that bipolar transistor, and replace it with a nice low RDS FET. You might then be able to play some more with the drive circuitry to its gate to get a quicker and sharper response at the device's drain. Might not make a jot of difference, but for the tiny cost and effort involved, probably worth a try.

Arfa

Reply to
Arfa Daily

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.