Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

Printer support #48

Open
thejpster opened this issue Dec 22, 2018 · 2 comments
Open

Printer support #48

thejpster opened this issue Dec 22, 2018 · 2 comments

Comments

@thejpster
Copy link
Owner

It would be fun to add Printer Support. There's two primary interfaces:

  • Old IBM LPT interface (8-bit parallel with control signals)
  • USB Printer

Obviously the latter requires USB host support but I think the first option is acheivable with an SPI or I2C I/O expander and some bit bashing. It wouldn't be fast, but it should work.

I have an old Panasonic dot-matrix I can test with. We would add LPT: as a device type you can open, along with disks, joysticks, keyboard and the screen.

@thejpster
Copy link
Owner Author

A Microchip MCP23S17 or MCP23017 would be ideal. An IEEE1284 'Centronics' interface has 8 data pins (host to device), 4 control lines (host to device) and 4 status lines (device to host). This matches the 16 pins on the MCP23x17. The MCP23x17 also has two interrupt lines, which we can use to avoid busy-waiting on the status lines, transferring bytes under interrupt from a small ring buffer.

The SPI version would have to share with the SD/MMC interface, but the I2C version could just sit on the I2C bus. Using I2C (which is open-drain) would also allow us to run the MCP23017 at 5V without needing level shifters either on the GPIO device input/output pin, or between the GPIO device and the host (because it's open-drain and the Launchpad is 5V tolerant).

So, we should use the MCP23017 for parallel printer support.

@thejpster
Copy link
Owner Author

The PCB has an Atmega48 wired up to the printer port.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant