I've long wanted to control my Arduino projects using some of my old computers, such as my Tandy 200, Macintosh LC475 or PowerMac 7200 which serve currently as my primary play machines.
I purchased some cheap MAX3232 serial adapters from Amazon and after much pain and agony I got them working.
The Sketch
First, let's start with the basic sketch to setup a software serial connection. I bumped down the rate from 9600 to 1200 baud to offer wider compatibility with older machines, but I could probably go for a higher rate if I wished to.
#include <SoftwareSerial.h>
// Define the pins for Software Serial
const int rxPin = 5;
const int txPin = 3;
// Set up a new SoftwareSerial object
SoftwareSerial rs232Serial(rxPin, txPin);
void setup() {
// Start the hardware serial port (to communicate with your PC)
Serial.begin(1200);
while (!Serial) {
; // wait for serial port to connect
}
Serial.println("Serial Monitor Ready!");
// Start the software serial port (to communicate with the MAX3232)
// Make sure your external RS232 device is set to the same baud rate!
rs232Serial.begin(1200);
Serial.println("RS232 Port Ready at 1200 baud.");
}
void loop() {
// Read from the RS232 module and send to the PC Serial Monitor
if (rs232Serial.available()) {
char inChar = rs232Serial.read();
Serial.print(inChar);
}
// Read from the PC Serial Monitor and send to the RS232 module
if (Serial.available()) {
char outChar = Serial.read();
rs232Serial.print(outChar);
}
}
The Modification
I was having a great deal of difficulty with connectivity issues on my Tandy 200. Using a null modem cable between my Mac running ZTerm and the Telcom program on the 200 I could easily chat back and forth. However when I plugged the Tandy into the MAX3232 I could send data from the serial monitor on the Arduino but sending from the Tandy caused a lockup of the system requiring a hard reset.
As it turns out, The Tandy (and the LC475 for that matter) both require the DCD line to be active for the send signal to be activated. This requires a modification that I had a great difficulty finding until I stumbled across a Sub-Etha Software page outlining the procedure.
Below is the modified module:
As you can see, the RTS/CTS lines are soldered together on the bottom of the board and DCD is tied DTR and DSR. This tricks the host such as the Tandy 200 into thinking the Arduino is online without the need for the Arduino to assert the DCD line.
The Circuit
It's quite a simple circuit after the modification has been completed. Here it is below:
Working Setup
The Tandy 200 is a little different from its older brother, the Tandy TRS80 Model 100 in that it uses a six character incantation for setting serial settings in Telcom unlike five for the 100. This is outlined on Page 45 of the Tandy 200 TELCOM referenced below. For 1200 baud without hardware handshake, 1 stop bit and 8 data bits I used this string:
58N1DIN
I used a straight through connection from the RS232 port through a homebrew 25pin to 9pin adapter to the Arduino.
And here's the entire setup. The Macbook Air is plugged into a FTDI serial module so I can monitor serial commands, you can also see the relay module in this picture that I'll be controlling through the serial connection. On the left next to the Tandy 200 you can see the edge of the irrigation manifold that I'll shortly be planting in the lawn.
And finally, I'll leave you with a little video demonstration of some serial chatting.