Electronics Repair (sci.electronics.repair) Discussion of repairing electronic equipment. Topics include requests for assistance, where to obtain servicing information and parts, techniques for diagnosis and repair, and annecdotes about success, failures and problems.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to sci.electronics.repair
external usenet poster
 
Posts: 1
Default 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?
  #2   Report Post  
Posted to sci.electronics.repair
external usenet poster
 
Posts: 6,772
Default usb-parallel adapter for I/O



"Chris Johnson" wrote in message
...
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?


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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jet Parallel Clamps... NOT Parallel? -MIKE- Woodworking 31 April 1st 10 02:15 AM
Parallel Jaw Clamps Tom Veatch[_2_] Woodworking 20 August 5th 09 10:39 AM
Can I charge my laptop with a 60W adapter instead of a 90W adapter?! [email protected] Electronics Repair 4 January 7th 07 01:58 AM
Sell:Brass Male Adapter,Swivel Female Adapter,Flare Adapter,Tee,Connector,Barbed Tee,Elbow, valvetom Home Repair 0 November 27th 06 05:50 PM
Parallel Printer Tap? Jeff Caspari Electronics 5 March 8th 06 03:32 PM


All times are GMT +1. The time now is 02:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 DIYbanter.
The comments are property of their posters.
 

About Us

"It's about DIY & home improvement"