Version 1.1.0 (10-October-2015)
Version 1.0.1 (9-November-2013)
TinyFSK is a program for the Arduino platform to send 5-bit Baudot (RTTY) by logically keying the PTT and FSK inputs of a transceiver. It is a transmit-only modem designed to integrate into logging software for contest/DXpedition use. It can also be used to control RTTY transmission from the keyboard using any terminal software that can open a serial port (e.g., HyperTerminal).
My main motivation was to build a simple and reproducible logical FSK keying interface for RTTY contesting. I was unhappy with the timing of the "bit banged" 45 baud FSK available with the EXTFSK plugin. Going to a "real" UART capable of 45 baud still required me to go through MMTTY for PTT and buffer management since N1MM can't do these things directly. So, I went "back to the future" to create a very simple TX-only modem that is reminiscent of the multimode TNC's of the 1990s. This puts all of the required functionality on a dedicated microprocessor.
The main features are:
The software should run on any Arduino or Arduino-compatible board. The compiled source is just over 6kB. I have been using it on the Arduino Nano board, as it has an FTDI chip and USB connector that is universally accepted on most OS's and won't have you playing games with drivers. The minimal schematic below shows its connections on an Arduino Nano board with the pins used in the source code, but of course you could recompile and reassign them as you wish. (D13 on the Nano has an on-board LED to provide some visual feedback when transmitting).
This implementation just uses two switching transistors in open collector configuration. Thus a logical high (5V on most Arduino boards) on D11 will effectively ground the PTT line, and a logical low will disconnect it. The FSK output works the same way, and there is a configuration option to reverse the polarity of this pin (that is, mark can be a logical high or a logical low depending on the requirements of your transceiver). You could, of course, replace the transistors with optoisolators if you wanted. Power is supplied by the USB bus. This really is all there is to the interface: an Arduino board (or compatible), two transistors, and two resistors.
Warning: some of the cheap Nano clones that can be found for around $10 on ebay and other places have a design flaw that might keep the FT232RL from enumerating consistently on your computer. This flaw left the test pin on the FT232RL floating when it should have been grounded. This can be fixed by bridging pins 26 and 25 together.
The serial interface is set to 9600-8-N-1, so any terminal software should use these
settings. Once connected to the port, you can enter configuration mode by pressing the
"tilda" (~) character. This will prompt you for options:
Enter configuration command. Valid commands are:
0 Set FSK polarity mark = HIGH
1 Set FSK polarity mark = LOW
4 Set 45.45 baud
5 Set 50 baud
7 Set 75 baud
? Show current configuration
Pressing any of those keys will display the new polarity and speed settings on the console and then return to the "normal" mode. Thus to set the device to 75 baud, all one has to do is type "~7". To set it back to 45 baud: "~4". The settings are immediately written to the EEPROM so that they will persist across power cycles. You should really only have to configure the device once for your radio, and unless you are switching between 45 and 75 baud often, you should not need to use the configuration mode again. (The default is for 45.45 baud and polarity "1".)
Any ASCII text sent over the serial port is converted to Baudot and sent over the air. LTRS/FIGS shift characters are automatically inserted into the outgoing Baudot stream as needed by TinyFSK. Lower case characters are converted to uppercase, and any punctuation that doesn't have a reasonable substitute in the US/ITA2 character sets will be converted to a "?" (the exact mappings can be found near the top of the source file). Any text that arrives before the transmitter is turned on (see below) will be stored in the buffer to be sent when the transmit command is received. This gives a rudimentary type-ahead buffer. As characters are sent they are echoed back to the terminal so one can monitor the progress of the transmission.
There are three TX/RX commands that can be sent over the serial interface to key the transmitter. The TX_ON command, '[' (open square bracket), is used to turn the transmitter on. Any text that is in the buffer will be sent. If the buffer becomes empty, an idle "diddle" (LTRS) will be sent until the buffer has data to send. The complementary TX_END command, ']' (close square bracket), is a buffered return to receive. This signals that the device should drop PTT when the buffer becomes empty. One can send RTTY with a "dumb terminal" set to 9600-8-N-1 by pressing the '[' character, typing the message at any speed and pressing the ']' to turn off the transmitter when the message finishes. Finally there is the TX_ABORT command, '\' (backslash) that will stop the transmitter immediately (if on), and dump any remaining text in the buffer.
After the PTT is dropped the string "cmd:" is returned to the terminal on a new line. This is necessary to signal to any contolling software that the "TNC" is done transmitting, but otherwise can be disregarded. The only commands that can be issued involve the configuration options above. Everything else will be placed into the buffer to be sent over the air.
The code is licensed under the MIT "Expat" license, which is located in the header of the source. The source code is available here, and can be uploaded just like any other Arduino sketch.
Note: This program relies on the Timer1 library modified by Paul Stoffregen under the Creative Commons license here . If you need to add this library to your Arduino IDE, you can unzip it into the "libraries" folder where Arduino IDE is installed (on windows the default location would be Program Files (x86)/Arduino/libraries). Once this is done, restart the Arduino IDE and you should be able to compile the sketch.