I kind of miss making hard copies of my program listings on a dot matrix printer. There’s something contemplative and satisfying about waiting for the printer to finish its buzzing and chattering so that you can pore over the code and find that bug.
Also, printouts on continuous listing paper with holes down the sides feel like real computing. It almost makes you want to put on a short-sleeved white shirt with pocket protector, dark tie and thick-rimmed glasses.
Now, you can buy USB-to-parallel adapters – I have one. I never could get the damn drivers to work, though. And most drivers that are designed for dot-matrix printers seem to assume that you want to treat any output as a graphic. Frankly, there’s already too much PostScript in the world.
I want to be able to send stuff to the printer from a program character-by-character.
Return of the Epson
I already have the printer (currently under repair). It was the first printer I ever bought, back in 1982 or 1983, and cost me far more money than I could afford. Even after it was replaced as my main printer – first by an improbably loud daisywheel device and then by an Epson laser printer that I ‘acquired’ in my role as a product reviewer, it continued to see service for niche applications.
Chief among these was as a label printer for my library of 35mm colour transparencies. I maintained a database of my slides, built using the Eagle database package from Emerald Bay (a kind of friendlier knock-off of dBase) and it was far easier to print labels programmatically to the dot matrix than it was to mess with sheets of labels on the laser. That’s the kind of functionality I miss.
So here’s the plan. I want to use a Raspberry Pi as a print server. Quite how it will do this is currently unclear – it might just monitor a shared folder for files and, if it finds one, prints it and then moves it to a ‘done’ folder. That’s as far as my thinking has gone on that side.
I could try to hook up the Pi’s GPIO pins to a DB25 socket and control the printer that way, but I want something more flexible and a little less blowy-uppy. So, an interface card of some kind.
I’ve already taken a small step in this direction. As part of my experimenting with the Eagle and KiCad EDA packages, I produced a design for a card that essentially just breaks out the connections from a DB25 socket, with the data lines being controlled by a shift register to reduce the number of pins needed on the Pi. At the time of writing, I’m still waiting for the fabbed boards to arrive from China.
But that was just to keep things simple for the purposes of learning KiCad and Eagle, and it doesn’t really address what I want from this project. So here’s where I’m heading with this:
- An AVR ATMEGA328P microcontroller will handle communications with the Raspberry Pi (or any other device) via a TTL serial connection.
- The AVR will set the data lines on the printer port via a 74HC595 shift register.
- The AVR will set or read the other signals (strobe, busy etc) via a buffer chip – a 74HC541.
- A resistor divider and jumper headers will allow the TX pin from the AVR to send signals at either 5V or 3.3V levels. The board as a whole will operate at 5V but should be able to cope (I think) with incoming serial data at 3.3V.
- I’m going to have three LEDs on the board controlled by the AVR to provide status information.
- I’m considering adding eight LEDs to show the data being sent over the data lines because … blinkenlights.
- There’ll be an ISP header on the board to program the AVR in situ.
So far, the schematic looks like this (click to enlarge):
If any experienced electronics engineers have advice, feel free to share. After all, I’m a novice at this.
The resulting board would be usable with anything that can send over serial – Raspberry Pi, BeagleBone, Teensy, Arduino, even my iMac.
But I need a name … the working title has been SmartParallel, but that’s boring. Given that I want this to drive my dot matrix printer, and that, with my level of electronics knowledge and experience this is probably a foolish venture, I think I’ll go with DottyMatrix.