Can I host an ASR33 Teletype with an Arduino?

I have been thinking about this for a project.

I have an ASR33 Teletype machine. It has an RS232 connection that currently I run off the serial port on an old PC. When the computer boots, the ASR33 acts as the terminal and I can do basic command line functions.

I can even run a couple of games like ADVENTURE.

Now I know that many out there may have no idea what I am talking about. This ADVENTURE works by just typing in short commands and it answers you to help you move through a maze.

Does anyone know if it would be possible to replace my old PC in this application with an Arduino?

Can the serial port on an Arduino operate at 110 baud?

Is there a BASIC that the Arduino can run in such a fashion?

Greg

gmcmurry:
I have been thinking about this for a project.

I have an ASR33 Teletype machine. It has an RS232 connection that currently I run off the serial port on an old PC. When the computer boots, the ASR33 acts as the terminal and I can do basic command line functions.

I can even run a couple of games like ADVENTURE.

Now I know that many out there may have no idea what I am talking about. This ADVENTURE works by just typing in short commands and it answers you to help you move through a maze.

Does anyone know if it would be possible to replace my old PC in this application with an Arduino?

Can the serial port on an Arduino operate at 110 baud?

Is there a BASIC that the Arduino can run in such a fashion?

Greg

I used anASR33 with a SYM-1, 6502 processor to simulate various async communications protocols while developing a uFEP, micro front-end-processor for data communications.

Should be a perfect match to Arduino. Did you try changing the serial baud rates to 110?

Paul

If the ASR33 uses RS232 then you will need a converter to talk to the TTL level pins on an Arduino

Is there a BASIC that the Arduino can run in such a fashion?

No

Grumpy_Mike says "NO" but I just found this:

Maybe my project has some hope.

I will need to see if I can run the serial port at such a slow speed. I haven't tried that yet.

The ASR33 is actually a current loop device, but years ago I made a current loop to RS232 converter so it would run on my old PC.

Ebay has cool RS232 to TTL converters for about a 3 bucks.

This is starting to look pretty good.

I am now remembering more and more.

Does anyone remember "half duplex"?

I think a big problem will be the 110 baud. I need to find a software serial that can run real slow. At 110 baud, there is quite a bit of room for error.

Greg

Mike's comment is appropriate if you're talking about using an Uno or other '328 class machine as they only have 2K of ram. As basic is usually interpreted, programs would normally be loaded into ram and since ASCII text is one byte per character, that leaves little room for the ram needs of the interpreter and the actual user program.

Yes, of course a fixed, proven and non-changing program like adventure could be placed into the flash space and run from there but the interpreter would have to implement that as well as being able to run in interactive mode from ram if that was a goal.

An ATmega1284P would give you 16k of ram. Or there's always a Teensy which has 256k in the 3.6 variant which is a ~$30 board. In the end, there are lots of choices that could work.

I guess the first task is to get an Arduino to even talk to the teletype.

I need some type of sketch that will use a software serial (for super slow speed) and operate at 110 baud, +/- 5%

and a program that will respond to some simple commands.

Greg

You can modify software serial to get that Baud rate. See this discussion. Google will find others.

Or, better yet, use the hardware serial port. It can easily be programmed for any arbitrary Baud rate, although for some Baud rates the error rate may be unacceptable. See the ATMega328 data sheet, UART section for how to do that.

Hi,

The ASR33 as you mentioned is actually current loop. It is 20mA. Open circuit voltage is around 75V or so as I recall. You could use an optical isolator and small transistor to drive the teletype from an Arduino pin.

OK -- I'm back on this.

I converted this ASR-33 to RS232 a long time ago. There are plenty of current loop to RS232 converters available or you can build one.

I can easily talk to the ASR with my computer over the serial port, or at least I used to be able to...

I think it was 110 N72 A total of 10 bits. 1 start bit, 7 data bits and 2 stop bits.

As soon as I get the linux program running again, I will at least have it running on a PC.

Then I need to run it for about two days to loosen up all the mechanical stuff. You have to run these machines or they clog up.

I'll post a video soon.

Greg

Hi,

Then I need to run it for about two days to loosen up all the mechanical stuff.

Some info: DOCUMENTATION

and lubrication (Very Important!) HERE

I used to repair/maintain model 15/16 for the Associated Press, back in ancient history..

There is a special interpreter for "Adventure-like" games (Zork!), and apparently at least one has ported that code to an Arduino. You'll need an SD card to hold the game descriptor files, where are (as pointed out by others) larger than the Arduino memory.
That particular version outputs to a TV, but it shouldn't be hard to modify it (or find another version) for TTY output.

Now, a normal AVR can not run as slow as 110bps on its hardware serial port. (I can't tell about SoftwareSerial (sigh))
It would not be awful to create some form of SoftwareSerial that COULD support 110bps, or you could slow the clock down to 4Mhz, which would allow hardware serial to do 110. Neither is "basic Arduino Programming", though.

From the best I can tell, including my own tests, the Arduino serial function cannot go 110 baud. However, I did find this:

/*Code for transmission of RTTY string borrowed from Robert Harrison.
 http://www.robertharrison.org/icarus/wordpress/about/
 
 Transmitted string is broken into each byte (character) with rtty_txstring and each byte
 into its corresponding bits with rtty_txbyte. The bits are then written out to Arduino pins
 with rtty_txbit.
 */

void rtty_txstring (char *string) // *variable is a pointer to the variable
{

  /* Simple function to send a char at a time to
   ** rtty_txbyte function.
   ** Each char is one byte (8 Bits)
   */

  char c;

  c = *string++;

  while ( c != '\0') // \0 denotes end of string
  {
    rtty_txbyte (c);
    c = *string++;  //move to c to next char of string
  }
}


void rtty_txbyte (char c)
{
  /* Simple function to sent each bit of a char to
   ** rtty_txbit function.
   ** The bits are sent Least Significant Bit first
   **
   ** All chars should be preceded with a 0 and
   ** proceded with a 1. 0 = Start bit; 1 = Stop bit
   */


  rtty_txbit (0); // Start bit

  // Send bits for char LSB first

  for (int i=0;i<8;i++) //8 bits in char (byte).
  {
    if (c & 1) rtty_txbit(1);

    else rtty_txbit(0);     

    c = c >> 1;

  }

  rtty_txbit (1); // Stop bit
}

void rtty_txbit (int bit)
{
  if (bit)
  {
    // high

    digitalWrite(rtty1,LOW);
    digitalWrite(rtty2, HIGH);


  }
  else
  {
    // low
    digitalWrite(rtty2, LOW);
    digitalWrite(rtty1, HIGH);

  }
  delay(19);
  delayMicroseconds(700);
}

That someone generated using rtty_txbit(). The example is for 50 baud. Maybe I can convert it to 110 baud.

Has anyone done that?

I think this only sends teletype and doesn't receive.

Maybe just having a little demo software would be enough for this project.

You could use hardware serial at 110 baud if you drop down to a 4MHz clock.

With respect to bit banging, generating output is trivial, receiving is more problematic but unquestionably doable at those speeds.

RTTY is normally transmitted with 5 data bits and 1.5 stop bits. The UART in the Arduino is capable of being set to this as far as I know. The half stop bit is important for synchronising to the signal, but once locked you could use two stop bits.

With respect to bit banging, generating output is trivial

Maybe. I mean, sure, if you want to spend all your time in delay functions waiting to output the next bit. But some of the softwareSerial implementations are based on timers, and then you have to start worrying about whether the timer you're using can do as much as 1/110 s ("just barely" for the 8bit timers. If you change the prescaler away from "normal.")

Thats correct for the older teletype machines.

I am using the ASR33 which is 110 N82 and uses ASCII. Many of the older TTY machines were Baudot Code. 5 bits 1.5 stop bits.

I think the Ham Radio users gave a rebirth to the use of Baudot.

The ASR-33 was originally built with a dialup 110 baud modem. I had one in my office that would reach our mainframe.

Then the hardwired them to the computer using the 20ma current loop. When the later DEC computers came around, so did CRT terminals. The ASR33 started being made in various versions where some only printed. They were still slow, and difficult to type on. You had to have a special technique to type on an ASR33 because the buttons had to be depressed about 3/8 of an inch and they were very mechnical.

It seems to me that the 300 baud modem started really making the ASR33 obsolete. Then the Decwriter LA36 that could go 30 cps (300 baud) came around. The ASR started getting pushed in the corner.

110 Baud data is 10 CPS but 2 stop bits (110 N82), therefore 11 bits transmitted per word. At 300 Baud with only 1 stop bit, we are only transmitting a 10 bit word. 300 N81

I have had an ASR33 around for about 50 years. Once in a while I get it out and get it going. My current unit is straight RS232. It will plug right into the serial port on the back of my PC (yes the PC is a little old). You need a real windows PC Serial Port. The USB Dongle Serial Adapters will not go 110 baud, I think for the same reason the Arduino will not.

Getting my project working again where the ASR33 can play command line games such as CAVE ADVENTURE should be fine after I clean up and lubricate the ASR33. I is a full duplex terminal so a loop back DB9 shorting 2 to 3 should allow me to exercise and fully test the unit before making it a terminal on my PC and talking to it with PUTTY.

After that, I will go after bit bashing a 110 baud output from an Ardruino and get the unit to print the alphabet and THE QUICK BROWN FOX... BTW ASR33 only does upper case.

Ribbons and paper are easy to get for these units but not so easy, 1" Paper Tape. Somehow paper tape has fallen from use. It used to be used on machine shop equipment as well in the motion picture printing business it was used to do color correction from scene to scene.

I should be able to find some 1" paper tape somewhere.

Thought I should put up this code for baudot, maybe get idea's -------

//---------------------------------------------------------------------
//
//
// KE6JMG
//
//
//----------------------------------------------------------------------

#include <stdio.h>

////////////////////////////////////////////////////////////////////////////
#define AFSK_OUT A1 // AFSK AUDIO Nano pin OUTPUT
#define MARK 1275 // AFSK mark 1275 hertz sinewave
#define SPACE 1445 // AFSK space 1445 hertz sinewave
#define BaudRate 45.45 // RTTY baud rate
#define StopBit 1.5 // stop bit long
#define SERBAUD 9600 // Serial port in/out baudrate
#define serialECHO // enable TX echo on serial port
////////////////////////////////////////////////////////////////////////////

int OneBit = 1/BaudRate*1000; // (22ms)
boolean d1;
boolean d2;
boolean d3;
boolean d4;
boolean d5;
boolean space;
char ch;

void setup()
{
pinMode(AFSK_OUT, OUTPUT);
Serial.begin(SERBAUD);
tone(AFSK_OUT, MARK);
sendFsk();
}

void sendFsk()
{
#if defined(serialECHO )
Serial.print(ch);Serial.print("--> ");Serial.print(d1);Serial.print(d2);
Serial.print(d3);Serial.print(d4);Serial.print(d5);
#endif

//--start bit
tone(AFSK_OUT, SPACE); delay(OneBit);

//--bit1
if(d1 == 1){tone(AFSK_OUT, MARK); }
else {tone(AFSK_OUT, SPACE);} delay(OneBit);

//--bit2
if(d2 == 1){tone(AFSK_OUT, MARK); }
else {tone(AFSK_OUT, SPACE);} delay(OneBit);

//--bit3
if(d3 == 1){tone(AFSK_OUT, MARK); }
else {tone(AFSK_OUT, SPACE);} delay(OneBit);

//--bit4
if(d4 == 1){tone(AFSK_OUT, MARK); }
else {tone(AFSK_OUT, SPACE);} delay(OneBit);

//--bit5
if(d5 == 1){tone(AFSK_OUT, MARK); }
else {tone(AFSK_OUT, SPACE);} delay(OneBit);

//--stop bit
tone(AFSK_OUT, MARK); delay(OneBit*StopBit);
}

void chTable()
{

if(ch == ' ')
{
d1 = 0; d2 = 0; d3 = 1; d4 = 0; d5 = 0;
space = 1;
}

else if(ch == 'A'){d1 = 1; d2 = 1; d3 = 0; d4 = 0; d5 = 0;}
else if(ch == 'B'){d1 = 1; d2 = 0; d3 = 0; d4 = 1; d5 = 1;}
else if(ch == 'C'){d1 = 0; d2 = 1; d3 = 1; d4 = 1; d5 = 0;}
else if(ch == 'D'){d1 = 1; d2 = 0; d3 = 0; d4 = 1; d5 = 0;}
else if(ch == 'E'){d1 = 1; d2 = 0; d3 = 0; d4 = 0; d5 = 0;}
else if(ch == 'F'){d1 = 1; d2 = 0; d3 = 1; d4 = 1; d5 = 0;}
else if(ch == 'G'){d1 = 0; d2 = 1; d3 = 0; d4 = 1; d5 = 1;}
else if(ch == 'H'){d1 = 0; d2 = 0; d3 = 1; d4 = 0; d5 = 1;}
else if(ch == 'I'){d1 = 0; d2 = 1; d3 = 1; d4 = 0; d5 = 0;}
else if(ch == 'J'){d1 = 1; d2 = 1; d3 = 0; d4 = 1; d5 = 0;}
else if(ch == 'K'){d1 = 1; d2 = 1; d3 = 1; d4 = 1; d5 = 0;}
else if(ch == 'L'){d1 = 0; d2 = 1; d3 = 0; d4 = 0; d5 = 1;}
else if(ch == 'M'){d1 = 0; d2 = 0; d3 = 1; d4 = 1; d5 = 1;}
else if(ch == 'N'){d1 = 0; d2 = 0; d3 = 1; d4 = 1; d5 = 0;}
else if(ch == 'O'){d1 = 0; d2 = 0; d3 = 0; d4 = 1; d5 = 1;}
else if(ch == 'P'){d1 = 0; d2 = 1; d3 = 1; d4 = 0; d5 = 1;}
else if(ch == 'Q'){d1 = 1; d2 = 1; d3 = 1; d4 = 0; d5 = 1;}
else if(ch == 'R'){d1 = 0; d2 = 1; d3 = 0; d4 = 1; d5 = 0;}
else if(ch == 'S'){d1 = 1; d2 = 0; d3 = 1; d4 = 0; d5 = 0;}
else if(ch == 'T'){d1 = 0; d2 = 0; d3 = 0; d4 = 0; d5 = 1;}
else if(ch == 'U'){d1 = 1; d2 = 1; d3 = 1; d4 = 0; d5 = 0;}
else if(ch == 'V'){d1 = 0; d2 = 1; d3 = 1; d4 = 1; d5 = 1;}
else if(ch == 'W'){d1 = 1; d2 = 1; d3 = 0; d4 = 0; d5 = 1;}
else if(ch == 'X'){d1 = 1; d2 = 0; d3 = 1; d4 = 1; d5 = 1;}
else if(ch == 'Y'){d1 = 1; d2 = 0; d3 = 1; d4 = 0; d5 = 1;}
else if(ch == 'Z'){d1 = 1; d2 = 0; d3 = 0; d4 = 0; d5 = 1;}
else if(ch == '0'){d1 = 0; d2 = 1; d3 = 1; d4 = 0; d5 = 1;}
else if(ch == '1'){d1 = 1; d2 = 1; d3 = 1; d4 = 0; d5 = 1;}
else if(ch == '2'){d1 = 1; d2 = 1; d3 = 0; d4 = 0; d5 = 1;}
else if(ch == '3'){d1 = 1; d2 = 0; d3 = 0; d4 = 0; d5 = 0;}
else if(ch == '4'){d1 = 0; d2 = 1; d3 = 0; d4 = 1; d5 = 0;}
else if(ch == '5'){d1 = 0; d2 = 0; d3 = 0; d4 = 0; d5 = 1;}
else if(ch == '6'){d1 = 1; d2 = 0; d3 = 1; d4 = 0; d5 = 1;}
else if(ch == '7'){d1 = 1; d2 = 1; d3 = 1; d4 = 0; d5 = 0;}
else if(ch == '8'){d1 = 0; d2 = 1; d3 = 1; d4 = 0; d5 = 0;}
else if(ch == '9'){d1 = 0; d2 = 0; d3 = 0; d4 = 1; d5 = 1;}
else if(ch == '-'){d1 = 1; d2 = 1; d3 = 0; d4 = 0; d5 = 0;}
else if(ch == '?'){d1 = 1; d2 = 0; d3 = 0; d4 = 1; d5 = 1;}
else if(ch == ':'){d1 = 0; d2 = 1; d3 = 1; d4 = 1; d5 = 0;}
else if(ch == '('){d1 = 1; d2 = 1; d3 = 1; d4 = 1; d5 = 0;}
else if(ch == ')'){d1 = 0; d2 = 1; d3 = 0; d4 = 0; d5 = 1;}
else if(ch == '.'){d1 = 0; d2 = 0; d3 = 1; d4 = 1; d5 = 1;}
else if(ch == ','){d1 = 0; d2 = 0; d3 = 1; d4 = 1; d5 = 0;}
else if(ch == '/'){d1 = 1; d2 = 0; d3 = 1; d4 = 1; d5 = 1;}
else if(ch == '+'){d1 = 1; d2 = 0; d3 = 0; d4 = 0; d5 = 1;}
else if(ch == '>'){d1 = 0; d2 = 1; d3 = 0; d4 = 0; d5 = 0;} //LF
else if(ch == '<'){d1 = 0; d2 = 0; d3 = 0; d4 = 1; d5 = 0;} //CR
else if(ch == '~'){d1 = 1; d2 = 1; d3 = 1; d4 = 1; d5 = 1;} //Letters
else if(ch == '`'){d1 = 1; d2 = 1; d3 = 0; d4 = 1; d5 = 1;} //Figures

else
{
ch = ' ';
d1 = 0; d2 = 0; d3 = 1; d4 = 0; d5 = 0;
space = 1;
}
}

void loop(){
if (Serial.available()) {

while (Serial.available()) {
ch = toUpperCase(Serial.read());
chTable();
sendFsk();
}
Serial.println();
tone(AFSK_OUT, MARK);
}
}