PARPORT This was a quickie little project intended to:
Hardware The hardware really was quick 'n' easy - except for the rotary encoder I got from Jameco, everything else came out of my parts bins. I actually got to use some old seven-segment LED displays I've had laying about for literally decades! See the schematic. The circuit depends on the data outputs (D7-D0) being totem-pole style active outputs (to supply sufficient current to LEDs), control outputs being open-collector style passive outputs with internal pull-up resistors, and status inputs having internal pull-up resistors. This is true of parallel ports on any but the oldest (and probably by now, rare) peecees. As a result, no passive components are required on the circuit board. Well, almost. It seems that the inexpensive rotary encoder is quite noisy, particularly on Channel A when Channel B is low. So I put a fairly big capacitor on the ACK line to help filter the interrupt signal. It works fairly well, probably a larger cap would work even better. I think there is a standard way of assigning seven-segment segments to pins. Probably the "a" and "b" should really be on the left side. But as long as it's consistent with the software, it works. I identified the pins by probing around with a small 5V power supply and a 470-ohm resistor. Parts List
Construction As seen in the photo, everything fits on a 0.1x0.1 matrix perf board. Two holes for the rotary encoder mounting tabs had to be drilled, and the holes for the switch terminals had to be drilled out, as the terminals were a bit too large for the perf board holes. After that, it was about an hour's worth of point-to-point wire-wrap wiring. Note the bank of 300-ohm resistors; this was from an earlier phase, when I had a single seven-segment being direct-driven by the port and needed dropping resistors. Rather than mess up the wiring by removing them, I simply jumpered over them. So the resistors are not there, electrically. But they look cool and electronic for younger people! Software The software is available here: The project builds under DJGPP v2.03 and requires the pdcurses 28 library. Unzip the project in a working directory and type "make". Then run "parport". A curses screen appears, and allows you to navigate to the various control fiels with the up/down arrows, and select different options with the left/right arrows. Description of files:
Note to diehard Windows users: The project will work under Windows. You have to get and install the MinGW system, the pdcurses system for MinGW, and io.dll that allows port access under Windows (see the remarks in lpt_ctrl.c). Copy "Makefile.mingw" over "Makefile" and then run "make". |