Hacker News new | past | comments | ask | show | jobs | submit login

I used to use the parallel port as basically GPIO. It was easy and cheap, before microcontrollers were as friendly to use as they are now.

I built a lot of custom stuff that way for my PC.




I ran my entire physics thesis project on the parallel port, using homemade ADC, DAC, and stepping motor drivers. Turbo Pascal provided built-in functions for the "port" i/o operations of the 8088 CPU. All's you needed was the address.

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.


> It was easy and cheap, before microcontrollers were as friendly to use as they are now.

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.


Things certainly got better. Now it is very possible to get Arduino devboards under $3 from China.

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.


Gamepads were standardized ADC converters too.

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.)


The Harvard architecture on Arduino and not being able to load code at run time is a real buzz kill. It would be so much better if you could execute out of RAM so young hobbyists could make their own Apple II grade hobby computer.


Microcontrollers were always weird. Z80, 8051, AVR... they never were designed to really use OSes like Linux or Windows (or Apple II).

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.


If memory serves, game ports on PCs didn't use any ADC as those would cost a lot in the 80s and 90s. They rather used the gamepad controller (a potentiometer) as part of a RC oscillator where the C was on the mainboard, then they would sample the period which would be proportional to the controller resistance and get the relative position.


An RC oscillator into a PWM pulsetrain sounds an awful lot like an Analog to Digital converter to me. :-)

Then again, I'm the type who considers an analog comparator to be a 1-bit ADC so...


> 20MHz Arduino Uno compares favorably to 16MHz 80386, its really just RAM that's feeble

It's 8bit, any operations with wider numbers require several instructions.


Arduino Uno is mostly 1-clock per instruction. A 16MHz ATMega328p scores 16MHz MIPS.

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.


One of the first (successful) things I built as a teenager was a parallel port to TI-82 com cable, so I could install games on my calculator.


Sound Source and Speech Thing were the weirdest things I recall plugging into a parallel port.

https://en.wikipedia.org/wiki/Covox_Speech_Thing


That's exactly the distinction. "Parallel Port" meant two things in the PC world:

* 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.


And the game port's Controller {1,2} {x,y} joystick position pins as four analog-in pins, and the PC speaker as analog-out.


Indeed, that's how basically everyone I knew growing up who managed to interface stuff to PCs did it. Except the one guy with a hand-me-down BeBox. That GeekPort was something to envy.


I never got why the GeekPort didn't catch on more beyond BeBox, even as an add in card, given how ubiquitous the parallel port was for interfacing with simple external electronics.


Yeah, there were tons of "basically a GeekPort for PCs" in the industrial control/test and measurement world, but not much aimed at home hackers or even really low-end experimentation. I don't know if that's a result of just the parallel port being used so often and it not being cost-effective, or what.

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.


Me too, I also had a board with 8 relays and a centronics printer connector. Super easy to switch stuff on and off safely back in the day when a PC was a serious investment.


Would that still work with USB → Parallel convertors?


I believe there are some rare adapters that will work with custom drivers, but almost all of them I've seen are programmed specifically to provide a printer device.


> Would that still work with USB → Parallel convertors?

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.


As much as FTDI annoys me, simply buying something like a 232H development board was my first thought, too.


Most seem to very specifically be IEEE 1284 adapters, rather than actual hardware parallel ports.


IEEE 1284 is the relevant standard for "modern" (ECP/EPP) parallel ports, but most adapters only provide that interface on the printer side, not a general-purpose host-side interface to control an IEEE 1284 port.


ECP and EPP are not really useful for GPIO-style use and even the simpler modes are not really desirable if the adapter is implementing the handshaking in hardware. You really just want to be able to manually control all the bits. The original parallel port (and later integrated ones when set to an appropriate mode in the BIOS) allowed this because it was a very simple device and relied on software to handle things like toggling the data strobe line when a byte was written to the data lines.


Yeah I drove stepper motors with the parallel port and some FETs all the time.


I started using PCs at the start of the century, and it had a parallel port (still in order). When I entered university about 15 yrs later, using it as a makeshift GPIO was my first use case, ... was too broke to afford a Raspberry Pi.

Now that I'm not broke anymore, still pi is out of stock everywhere




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: