http://neil.franklin.ch/Projects/Parport/LED_Tester author Neil Franklin, last modification 2007.10.30 Aim was to build the same type of LED tester device that exists for RS232, for signal viewing, for software debugging, but for the parport. This consists of each an DB25m (PC) to DB25f (printer cable) connector, with an small board in between with LEDs and their resistors on it. A brief googling shows that noone has made one of these, or at least noone has documented one for copying. So I developed my own one (mainly find sensible R values) and put it up on the net. Parallel Port Specification --------------------------- c't 88-6p166 article, and online pc hardware collection http://www.nondot.org/sabre/os/articles/CommunicationDevices/ data, 3-state-able, out enabled by control bit 5 low address 3BDh|378h|278h (MDA/MGA/VGA|CGA/multi-IO|multi-IO-2nd) bits 7-0 pins 9-2 signal data7-data0 status, input only address 3BEh|379h|279h bits 7-3(-0) pins ^11|10|12|13|15(|-|-|-) signal ^busy|/ack|paper-end|select|/error(|*/irq|-|-) ^busy reads inverted as /busy */irq only reads internal FF, no pin control, open collector, 0 forces out, 1 allows read in address 3BFh|37Ah|27Ah bits (7-)3-0 pins (-|-|*|*|)^17|16|^14|^1 signal (-|-|*/outen|*irqen|)^/selectin|/reset|^/feed|^/strobe ^/selin, ^/feed, ^/strobe are inverted, write/read as selin, feed, strobe */outen and *irqen only set internal FFs, no pins */outen can not be read, this screws up read-modify-write! Thanks IBM! ground, no address, no bits, pins 18-25 no power, a serious design ommission, *grml* What we need ------------ For all 17 signal pins/wires (pins 1-17) each an LED and its R What we have ------------ The parport has only TTL 5/0V signals, no RS232 +12/-12, so there is no need for 2-colour LEDs like in RS232 testers. As we only need 1 colour per LED, so we can use multiple colors to show the type of the displayed signal: 8 data green 4 pc->printer control yellow 5 printer->pc status red DB25m from wiring side (DB25f is mirror image) ---------------------------------------------- /strobe ctrl/yellow 1 14 ctrl/yellow /feed (/auto-feed) (/auto-fdxt) data0 data/green 2 15 stat/red /error (/fault) data1 data/green 3 16 ctrl/yellow /reset data2 data/green 4 17 ctrl/yellow /select-in data3 data/green 5 18 -/- GND data4 data/green 6 19 -/- GND data5 data/green 7 20 -/- GND data6 data/green 8 21 -/- GND data6 data/green 9 22 -/- GND /ack stat/red 10 23 -/- GND busy stat/red 11 24 -/- GND p-end stat/red 12 25 -/- GND select stat/red 13 Signal Display -------------- Activate light when signal high, 5V, so wire LEDs to GND. But this means that power has to come through the TLL outputs current limit resistor. For powering LEDs it would be ideal for active light when low, LED to 5V, but no 5V. But this is bad for data displaying, reversed sense, needs inverters, and they need power supply. The parallel port has no power supply pins, a serious ommission. We can also not take it via diodes from usually high out pins (/reset, /feed, /strobe) as these may all be low, and have only little power, nowhere near enough for 17 LEDs. Power Computations ------------------ Standard LED data seems to all be to given in ??Cd @ 20mA, seldom @ 80mA. For high active this gives: 5V, -1V internal 50ohm loss, -1.7V LED = ~2.3V, so 20mA @ 115ohm, and low active gives: 5V, -1.7V LED = ~3.3V, so 20mA @ 160ohm. The parport has by tradition an 74LS374 as driver, which has -2.6mA (ingoing!) recommended, no outgoing given, appart from internal 30-130mA short protection resistor. Best would be to amplify the signals, but again the parport has no power for this. So this is not an option, unless with an external power supply, and lots more cable salad. So go for minimal LED current to minimise signal voltage loss. So large Rs are needed, to limit I, and so will give little power to the LEDs. Something like 470|1000ohm, for 7|3mA. LEDs should actually work with 2mA according to http://www.b-kainka.de/bastel57.htm (gives working down to 1/10 current) and we only need visible light at 1/2m, not at 5m through room. So 1/10 brightness is OK (at 1/10 current and constant voltage). Also according to colleague Attila there exist special low power LEDs for battery, work officially with 2mA. Try this approach, first with standard LEDs. Look out if LED+R to GND may be enough to sink connected devices input current, triggering it, giving an false 0. TTL only assumes current flowing from driven device to driving device (inwards), not actual voltage. - Totem pole outputs pull up with 50ohm(LS) + T, if LED pulls down with R 470|1000 to LED 0.7V, it should stay way above the 2.4V top border for 0-triggering of connected input - Open Collector outputs are only pulled up with an external R. TI data book recommends ca 300-3000ohm (10-1 driven devices). I can not find any docs what is used in the PC, but as only for printer+readback (2 devices) I will assume 1k. Looked at an old non-integrated parport card of old 386, but 734 is already integrated into an W16C451 chip. It this is an problem, actually all OC signals are active-low signals, best show them then inverted, by LED up to +5V. But the only power source for this are usually high outputs, an those are exactly these 4 OCs. So this approach falis, in addition to being bad with reversed signals. Tests of LEDs and R Values -------------------------- LEDS: red 1.7V, yellow and green both 2.1V Used small supply, 13.5V/1A power brick + 10uF + 0.1uF + 78L05 + 0.1uF = 5.1V and an totem pole TTL chip, an 74LS00, was first out of box. unloaded output: 4.5V red+1k as load: 3.5V-1.7V=1.8v, 1.8V/1kohm=1.8mA, too dark red+470 as load: 3.5V-1.7V=1.8V, 1.8V/470ohm=3.8mA, still too dark red+220 as load: 3.4V-1.7V=1.7V, 1.7V/220ohm=7.7mA, is bright enough yellow+220 as load: 3.4V-2.1V = 1.3V/220ohm=5.9mA, not quite as bright, OK green+220 same as yellow+220, surprisingly have same voltage over diode red+270 as load: 3.4V-1.7V=1.7V, 1.7V/270ohm=6.2mA, reduce to same bright This gives for 74LS00 roughly 5.1-3.4=1.7V, 1.7V/6mA=283ohm internal, high. If parport OC pins have 330ohm (minimal) then same the circuit is universal. If parport OC pins have 1kohm (medium) then 4mA shoudl happen, still just about usable. Only if parport OC pins have 3.3kohm (maximum) will this fail. Try with actual PC (k6-2/350 motherboard) parport. unloaded output: 4.4V red+270 as load: 2.35V-1.7=0.65V, 0.65V/270ohm=2.4mA, darker but usable red+150 as load: 2.35V-1.7V=0.7V, 0.7V/150ohm=4.6mA, not really much better red+100 as load: 2.2V-1.7=0.5V, 0.5V/100ohm=5mA, decent but not large note port voltage drop, 5mA seems to be limit that we can get out here yellow+82 as load: 2.3V-2.1V=0.2V, 0.2V/82ohm=2.4mA, not much improvement yellow+56 as load: 2.2V-2.0V=0.2V, 0.2V/56ohm=3.5mA, slightly more yellow+220 as load: 2.4V-2.0V=0.4V, 0.4V/220ohm=1.8mA, and about same Try with 2nd actual PC (Pentium-M/1600 notebook) parport. unloaded output: 3.5V red+220 as load: 3.1V-1.7V=1.4V, 1.4V/220ohm=6.3mA, and bright yellow+220 as load: 3.2V-2.1V=1.1V, 1.1V/220ohm=5.0mA, and bright red+270 as load: 3.2V-1.7V=1.5V, 1.5V/270ohm=5.5mA, and bright Try with 3rd PC available, has an actual 74LS374 chip in it, so assume same as with the 74LS00. So go for red=270ohm and yellow/green=220ohm. This is good for TTL and notebook and still usable for the k6-2/350. I decided to wire all LEDs to GND, including the OC pins, no inversion, see the true state of port. And also get rid of problem with creating an VCC for low active pins LEDs. Building the Tester ------------------- Used an small perfboard. As we are doing many LED-R connections best use an pre-cut 2-hole islands type. I used Vellemann ecs2. As we need 13 LEDs next to each other (for top pins row) use 2.5mm wide ones. So the board width is then 1+13+1=15 holes for 13 LEDs and 2 edges. As we need 2 rows of LEDs and 2 rows of Rs, run the 2-hole islands in this direction. Board is 1+2+2+2+2+2+1=12 holes for Connector R LED LED R Connector, as follows: 13* 13* 4* 4* DB25m R LED LED R DB25f top top bot bot .--. .-. .-. .--. | [] | | | | [] | .--|== | [] --- --- [] | ==|--. | | -- ---- ---- ---- ---- ---- -- | | `--|== | | | |--| | | | ==|--' -o- -o- signal GND signal wires bar wires The connectors I used are "straight" tyles as used for soldering onto cables, not the "bent" types for inserting onto an board. The board is slotted in between the pin rows (it nicely fits), which gets rid of all problems with the board laying on the table (and possible shorting), and makes the entire devise compacter. At the connectors the 2.54mm (100mil) raster does not allign with the connectors pins, so I have cut all 1-long half-islands lengthwise in the middle (there where the hole ist), getting an 1.27mm (50mil) raster. These islands are not used for contacts anyway, solder there is purely mechanical! The LEDs and Rs make 2 rows, 13 at top, 4 at botton, fitting the 13+4 pins used for signals. The other 8 places are simply left empty: g r 13/25 14/1 o .-------------. u | | DB25m n --------------------- d .`-------------'. ground bar .--- | | | | ||||||||||||| | | | ooooooooooooo | 13 Rs top ground bar |___ | OOOOOOOOOOOOO | 13 LEDs top 4 red 8 green 1 yellow ¡ | OOOO | 4 LEDs bottom 2 yellow 1 red 1 yellow | | oooo | 4 Rs bottom | | |||| | ground bar `--- | | l `.-------------.` e --------------------- n | | DB25f g `-------------' t 13/25 14/1 h Ground is "wired" in form of 1 "bar" crossing all 13 islands between the 2 rows of LEDs. At both connector ends 2 more bars run cross all 8 GND pins, which are all on the bottom row. At the side where all GND pins are (left in above) a fourth bar runs lengthwise. This creates an "E" shape. As all GND-GND and all GND-LED connections are handled this way, and all R-LED connections are by the islands, we now only need the 17 data signal wires. These must run connector-R-connector, not to the LEDs! I have used insulated wire, with the insulation cut open at the appropriate place where it should connect to the R. This has become a bit messy due to molten insulation, and initially caused a few shorts that nedded fixing! At least the mess is behind the board. Self-deisolating wire would be a lot better. For the 4 "bottom row" LED, the wires simply run pin-R-pin, as these pins are on the bottom row. For the 13 "top row" LEDs it is a bit more difficult, as the pins are on the top board side! At least they are difficutlt if you do not want messy wires running over the top of the board. And the R terminals are on the bottom anyway. I have therefore "poked" the wires up from the bottom, between the connector pins and the board! For this the connectors are not pressed entirely onto the board. This took quite a bit of work to get right, without shorts. But the result looks extremely neat (at least from the top). Follow up Project: An RS232 Tester ---------------------------------- After using above device for nearly 2 years I actually needed an genuine RS232 tester. Having done above work, I simply duplicated it, with small changes: Same are: - same 2 connectors, DB25f and DB25m, for RS232 DTE and DCE - same board type (Vellemann ecs2) and size (13 wide x 12 long holes) - same mechanical and electrical construction - same wiring techniques Different are: - only 7 signals, 6 on top row (pins 2-6,8) and 1 on bottom row (pin 20) of these 3 are driven by DTE (pins 2/TxD, 4/RTS, 20/DTR) and 4 are driven by DCE (pins 3/RxD, 5/CTS, 6/DSR, 8/DCD) so I used the DTE/DCE directions as rows, as RS232 is bidirectional - only 3 or 4 LEDs per row, so I used full 5mm types, spaced at 2 holes 6 distances times 2 holes wide is identical with 12 distances times 1 hole! DTR is offset by 1 hole from its raster place, to symbolise "bottom row"! - +12V/-12V instead of 5V/0V, so I used 2-color LEDs, green=+12V, red=-12V that means that "green" pin is connected tor R, and "red" pin to GND - larger voltage needs larger R value: 1500ohm that has turned out to be on large side, and a bit dim display - ground is only "middle of LEDs" ground bar, no multiple GND pins (only pin 7) no pins ground bar, no length bar, no "E" shape, so use an pin7-bar-pin7 wire - only 1 bottom row pin-R-pin wire (pin 20/DTR) - 6 top row pin-R-pin wires, using same "poke through" method Photos ------ Top side: http://neil.franklin.ch/Projects/Parport/Photos/IMG_1874.JPG Bottom side: http://neil.franklin.ch/Projects/Parport/Photos/IMG_1875.JPG