AVR USB printer device and teletype

I have old teletype printer T-63 (it is made by RTF in Eastern Germany, clone of old Siemens Teletype). And the idea is about connecting it as USB printer to our-days computer. Easiest way is to connect it using RS232 port, configured to 50bod speed and 5 data bits. But I was thinking about real USB printer.
Somehow I didn’t managed to program old AVR Atmega16 series MCU with V-USB library as printer. Windows is detecting as “printer”, but “cannot start”. Next device available was ATMEGA32U4 board from China, for about 2€. It is more modern chip, with build in USB hardware. I selected LUFA library (latest version, downloaded with git).

AVR ATMEGA32U4 as printer device for TTY teleprinter

This is very small board with everything already soldered for testing. For electrical compatibility I used SSR (solid state relay)- I need to link TTL level with 40mA (50…120V) current loop.

testing gear- windows 10, macos x and linux
I wrote all stuff on windows 10 Pro computer. I managed to emulate “text only”, “generic” printer. Windows downloaded drivers and installed them automatically, but I encountered some weird problems: windows can print only few hundreds of symbols. After it printing stalls, and after few minutes print spooler reports error.
I switched computer to old Apple Air with old Mac OS X (10.6?). Mac OS detected printer, but there was no downloadable drivers. After playing with CUPS, I installed RAW printer driver. But there is problem with modern computers- even if I was printing plain text file (‘The Call of Cthulhu’), apple “text editor” was sending PDF formated data to printer.
Next computer was Linux Mint (also very old version). Linux detected and installed text only printer driver. But when printing same text from some type of text viewer the output was nill. Why? When switched to raw printer driver, output was same PDF signature and binary data. Same shit… why modern software make all jobs so complicated?
But there was good news- all that binary data was sent to printer without any problems. So, printing in Windows 10 was the windows drivers problem, not AVR device.

Thanks to all gods (and the older ones), but there is old school command prompt (shell) in linux. And only few lines of commands and that dark text appeared on paper with 50+ years old teletype printer.

teletype printer output from modern computer via AVR ATMEGA MCU USB device

All source code is free and available for download:
USB printer device on AVR ATMEGA32U4 source code LUFA. With ‘The Call of Cthulhu’ testing text included.
To compile, please download latest LUFA library from github.

Lithuanian, extended version. Hardware (Lithuanian).

About Administrator

I am owner of this site.
This entry was posted in MCU and tagged , , , . Bookmark the permalink.

4 Responses to AVR USB printer device and teletype

  1. In near future I’ll fix width of this blog.

  2. Serge says:

    Hi! Did you continue the project? I have a likely problem, but I need to make it working under Win10 and I have no clue why it is such a problem to make simple devices under modern OS.

  3. I moved to STM32 and completed printer device.
    AVR version is missing some usb request interpretation. (Also, lack of drivers in windows) , but in command prompt mode it works fine.

    See untranslated version: http://www.vabolis.lt/2020/08/29/arm0018-stm32cubemx-hack-printerio-klase/

    The last version for download is in the comments.

    Another crazy printer based on STM32:

    If using CDC (serial) USB device, hardware handshake is mandatory with slow TTY.
    There is in deep analysis how to implement handshake in STM32:

  4. Serge says:

    Thank you very much.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>