The Parallel Port
computer.rip
computer.rip
Given the idle nature of a month or two at sea, I started looking at the bathymetric electrostatic chart printer we had, and realized it had some kind of 4 bit output that was basically the raster of each depth print scan.
So what I recall is wiring up the 4 pins to the 4 inputs (Busy, Paper-Out, Select, Error) on the DB25 on some PC, and scanning those to read the current bathymetric trace. Then turn that into a visual depth display overlaid on the 640x480 VGA display of the SeaSoar's position.
Eventually then, I was able to figure out where the bottom was and have it automatically do a "turn up" when it got within a certain range of the bottom. Bit of a knuckle biter the first time I had to trust it to not smash a quarter million $ instrument into the sea floor.
These were fun hacks. You're at sea, no internet, no place for parts, just hacking together stuff and dealing in the moment.
The history in the linked article is quite comprehensive, and touched on the slightly-incompatible (EPP, ECP) standardization efforts for bidirectional use. When USB finally came along, that made things a lot more convenient.
I got a hold of a FireWire card and a Sony CD-RW (i.Link or whatever they called their version) and never looked back.
Related: https://retro.m1ner.co.uk/2017/08/homebrew-covox-speech-thin...
I built a lot of custom stuff that way for my PC.
I use FTDI 232h based devices to drive 433Mhz transmitters, using gpio/bitbang functionality. There are multiple pins that can be used for that so theoretical parallel port like functionality can be achieved.
I got started with AVR microcontrollers with a DIY parallel port ISP adapter: just cut a printer cable in half, solder in 4 resistors and you were good to go :-)
Then spend a ridiculous amount of time re-learning assembly to port the parallel port LED blinking program from DOS to the AVR.
Only needing the few scavenged parts and buying just the MCU was a lot cheaper than buying the "recommended" adapter cable or some eval board, making the whole thing affordable for my 13 year old self.
If you must, as it's possible at the same prices to instead get much more powerful microcontrollers with RISC-V or ARM processors, like the ESP32 or STM32 lines.
A buddy of mine got an Apple Mac. It was lovely, except... no GPIO. But it had a serial port. Creating simple devices that could talk to the Mac serial port was my first introduction to microcontrollers. Of course, programming those microcontrollers required a device programmer, which I built and connected to... you guessed it... the parallel printer port of my PC.
In the pre-PC home computer world, there were products like that, and even in the early x86 ISA PC world, there were analog/digital I/O cards that didn't break the bank.
Early PCs were actually really similar to modern Arduino boards. UART for Serial Port, GPIO is basically parallel ports, ADC vs Gamepad port, etc. etc.
20MHz Arduino Uno compares favorably to 16MHz 80386, its really just RAM that's feeble (2kB SRAM on Arduino Uno, which is much less than computers in the 80s), but its not too hard to expand RAM out a bit (or buy a comparable uC today that has 1MB or so of RAM)
-----------
Even then, today's I2C ports (Arduino / Rasp. Pi) are way easier than old ISA stuff, but you run into very similar issues. I2C address collisions can cause a lot of pain, and ISA boards had DIP switches to move those peripherals to other ports.
I2C is much more streamlined compared to ISA. Especially because we don't care about speed anymore (if you "need speed", USB and other protocols exist. All the protocols for modern uCs are for convenience: SPI, UART, I2C, etc. etc.)
That being said: Rasp. Pi, Beaglebone Black, Le Potato, and many other SBCs are proper computers with proper OS support.
---------
Back in the 80s, the Microcontroller vs Microcomputer concept wasn't really solidified yet. Yes, the 8051 and Z80 existed, but they were still external memory bus and kinda microprocessor-ish.
Then again, I'm the type who considers an analog comparator to be a 1-bit ADC so...
It's 8bit, any operations with wider numbers require several instructions.
80386 was mostly 4-clocks per instruction. A 20MHz 80386 only scored 5MHz MIPS. Most 1980s/90s computers were multiple-clock-ticks per instruction (8051 was 12-cycles per instruction, so a 12MHz 8051 is only 1 MIPS).
I don't think Intel got to single-cycle instructions until 80486?? Hard to remember all the differences...
Furthermore, the ATMega328p has many 16-bit instructions, like add, which operate over two registers in one clock tick.
* An ad hoc standard descended from Centronics printers for transferring data on a 7 bit parallel TTL bus.
* The IBM PC Parallel Port Interface, an extremely simple (like four chips!) 8086 ioport based controller for the various lines in the port that was used for decades as a general GPIO interface for whatever gadgets you wanted to hack together.
To the enduring shame of everyone involved in the disaster, the USB standardization process for "parallel port" treated only the first definition. It only does data transfer at the line level, there's no individual control over the wires as there is for the PC interface.
It's basically useless, unless your problem really is to connect a printer to your USB host. That said, there are proper USB GPIO controllers out there. But DOS software written to the old standard (and there was a lot of it!) is unrunnable junk now.
Now that I'm not broke anymore, still pi is out of stock everywhere
The "Speech Thing" [1] is the most commercial example I can think of, until "laplink" hit.
Before they disappeared, printer ports on motherboards began getting worse for latency and compatibility. This was likely due to cost reduction since low latency two-way communication was not needed for printing.
There was an interface for old Commodore floppy drives that is just remapped pins on the printer port[1]. When PC's circa 2005 stopped working with it, I designed a USB microcontroller board to implement the protocol[2]. It had to do some fancy state machines to get around the round-trip problem, caching a set of commands until the host was ready for the transfer. Then it would send them all back-to-back and start streaming back the bulk data. Fun stuff.
This sounds an order of magnitude wrong. I have just setup a loopback with a CH340 USB to serial adapter and ran the following code:
#!/usr/bin/python3
import serial
import time
ser = serial.Serial(port="/dev/ttyUSB0", baudrate=1_000_000, timeout=1)
iters = 100
x = time.time()
for i in range(iters):
towrite = b"%i\n"%i
ser.write(towrite)
line = ser.readline()
assert(line == towrite)
delta_ms = (time.time() - x)*1000
print("Finished %i iterations in %ims = %.1fms/iteration"%(iters, delta_ms, delta_ms/iters))
and it says Finished 100 iterations in 272ms = 2.7ms/iterationOh the memories.
I don’t think any of the devices in use have a (parallel) printer port though.
Eventually, my father had some board using parallel port for stuff. Including a Dobson telescope control board (based on Mel Barters designs). I had half-write a program to control it from Visual Basic (there was some VB controls that allow to direct control of the parallel port). Sadly, the Dobson mount and the control board was lost when we move to a new house.
I guess this is talking about the XT and AT, but the article kind of makes it sound like this simple bidirectional mode was gone from all PCs after the 5150 when it in fact came back with the PS/2 and remained present on clones long after that. You generally needed to set the right parallel port mode in the BIOS, but I was using this simple bidirectional mode for communicating with a Sega Genesis over its controller port in the mid-2000s.
You got me curious about this and so I looked into it a bit further. I managed to find IBM's technical documentation[0] for the original printer original printer port card and it looks like it only sort of supports bidirectional use of the data pins. It supports reading the state of the data pins, but it seems this was intended to be used for diagnostic purposes. There's no way to disable the output drivers for these pins like there are on later bidirectional ports. The manual does mention that if something happens to drive the pins the result of reading the port will be that value ORed with whatever was written previously (though I've seen claims elsewhere that it's actually more of an AND), but it also cautions that driving these pins externallly is "in violation of usage ground rules". Apparently some folks did use it this way though and perhaps that's what inspired making it properly supported in the PS/2.
It's unclear where this idea that the original PC had this feature, but it went away came from. I looked at the manual for the AT's serial/parallel combo card[1] and the parallel port portion is almost identical. I guess it's possible the hack to use unidirectional didn't work in some 3rd party cards or clones.
[0] https://minuszerodegrees.net/oa/OA%20-%20IBM%20Printer%20Ada...
[1] https://www.minuszerodegrees.net/oa/OA%20-%20IBM%20PC%20AT%2...
I plug/unplug many times a printer, and a ZIP disk unit, to the parallel port without issues on Windows 95/98/ME. And more recently, a 90's Roland plotter on a 2010's computer that have yet a parallel port, running Debian.
https://forum.vcfed.org/index.php?threads/486-motherboard-ke...
The article mentioned there was an effective dma mode where the parallel port was wired directly into the isa bus. I imagine that if a port was in that state it could cause some real havoc if something suddenly got plugged in.
I run a machine from Mach3 using a tiny microcontroller (a UC100) to send pulses down a parallel port (though it is controlled by USB).
i also had a zip drive that plugged into the parallel port, which worked surprisingly well.
The control lines can be abused as GPIOs, but I would not recommend doing so.
Many USB to TTL UART chips do also expose GPIO functionality, if you want somewhat direct access to GPIOs.
I recommend the RISC-V based ones (e.g. ESP32-C6, CH32V, GD32V, K210).
Some SBCs double as development boards, with huge GPIOs capable of a lot besides basic I/O (PWM, I2C, SPI, UART, I2S...)
The new, RISC-V based, "VisionFive 2" is a lot of fun.