Using a PC as a Beacon Message Generator

by Lyle Koehler, KØLR

The original version of this article appeared in the July 1994 LOWDOWN. An option to provide a long dash after the message was added on 3/31/00 at the suggestion of Jack, WA7LNW. On 11/27/00, a new version of the beacon identifier program called BCN.EXE was placed in the BCN.ZIP file. It is identical to the old BCN.EXE in function, but contains a fix that allows very slow speed operation (less than 1 WPM) even on faster computers. The old version of BCN will hang up if you are running on a fast computer, using a serial or parallel port to key the transmitter, and set the CW speed much below 1 WPM.

At the request of John Hoopes, AB4MS/JDH, I added a  two-speed keyer version  on 12/10/00, which is described at the end of this article.

Although it's a classic case of overkill, a personal computer offers an easy and versatile way to put CW messages on your beacon. All you need is a PC, a simple interface circuit, and a program that will convert text to code and key one of the PC's output ports. The PC can be tucked in a corner of the shack and doesn't even need a keyboard or monitor as long as you have access to another computer to set up the program and edit the messages you want to send. Any old IBM-compatible PC should do, as long as it has a working floppy drive and one unused serial or parallel port.

Figure 1 shows suggested keying interfaces for a serial communications (COM) port or parallel line printer (LPT) port. The direct interfaces are simpler but an isolated interface is strongly recommended to keep stray voltages and ground loops from zapping the computer. There are many optoisolators that have the same pinouts and should work in this application. Examples are the 4N29 or H11AV1, both of which are listed in the Mouser Electronics and Digi-Key catalogs. Unfortunately Radio Shack doesn't carry a suitable optoisolator for this application.

The COM port outputs swing between plus and minus 12 volts. Diode protection is provided to keep the negative swings from damaging the keying transistor or optoisolator. Writing a 1 to the COM port's control register will drive the Data Terminal Ready (DTR) line high and the Request to Send (RTS) line low. Writing a 2 to the control register will drive DTR low and RTS high. Using the values 1 and 2 for the key-down and key-up conditions will provide simultaneous normal and inverted keying signals.

In the case of the LPT ports there is a wide variation between computers in how much current the port can deliver. To provide some assurance that the optoisolator or transistor gets turned on solidly, several of the data lines can be connected in parallel. Diode isolation is shown in Figure 1 so that one data line won't try to pull down another one. Writing the number 15 to an LPT data register will drive data bits 0 through 3 to + 5 volts and data bits 4 through 7 to zero volts. Writing the number 240 will drive bits 0-3 low and bits 4-7 high. This provides two sets of parallel keying lines -- four normal and four inverted.

For normal keying, the DTR line or data lines D0-D3 are connected to the input of the interface circuit.
I've written a BASIC beacon identifier program that lets you invoke a number of options from the keyboard. You can change the code speed, enter messages and store them to disk, read existing disk files, change output ports, direct the output to the speaker or use the computer as a keyboard keyer. This program is available as BCN.BAS, which will run with most DOS BASIC interpreters, and as a standalone file called BCN.EXE. Both programs plus documentation on how to use them are contained in the file BCN.ZIP. After downloading, I recommend moving BCN.ZIP to its own directory before unzipping it.

For those with some BASIC experience, a stripped-down version of the program is also available as PC-ID.BASIC. Before you run the program, you will need to edit the first few lines of the program to set the code speed, message and output port variables. Line 20 sets the code speed. The desired message and identifier strings are defined in lines 30 and 40. Each string can be zero to 255 characters long and must be enclosed in quotation marks. The program will keep cycling through the message string followed by the identifier string, so it doesn't make any difference which comes first.

The only tough part is figuring out the address of the port you want to use. Typical hexadecimal addresses are: COM1 = &H3FC, COM2 = &H2FC, and LPT1 = &H378. The COM port addresses are the addresses for the port's control register and are offset from the commonly- used port address. For example, the address for COM1's data buffer is 3F8 but its control register is 3FC. To be sure of the correct address you will have to consult the hardware documentation or use a diagnostic program to show you the base address for the desired port on your computer. In the case of the COM ports you need to add 4 to the base address to correct it for the offset. The &H prefix is needed to tell BASIC the number is hexadecimal.

The numbers that will be written to the ports for the keydown and keyup conditions are entered in line 60. Using DN = 1 and UP = 2 for COM ports or DN = 15 and UP = 240 for LPT ports will provide normal and inverted keying signals on the DTR/RTS or LPT data lines as described above.

One note of caution: My programs will not work properly under Windows 3.1, even from the Windows MS-DOS prompt, but will run if started as a DOS application outside Windows. I've used the BCN program successfully on a couple of Windows 95 computers, although the code speed came out about 50 per cent high when using the COM or LPT output ports (it seemed OK with the speaker output). Your mileage with Windows 95 may vary. If your computer only operates under Windows 95, the easiest solution is to pick up an old beater at a swap meet. A reasonable price for an old PC that is suitable for this application is between zero and 25 dollars.

Two-Speed Keyer Version

This version of the software can be downloaded along with its associated configuration file as  BCN-2SP.ZIP . It is identical to the BCN program except that two code speeds can be transmitted, and you can control which parts of your repeated identifier/message string are sent at each speed. Default values in the supplied configuration file are 12 and 5 WPM, but you can change the code speeds withing the program by using the "C" command and then update the configuration file with the "S" command. It's best to do all testing and get your port, ID string, etc. all set up before changing to a really slow code speed. The program checks the keyboard buffer after each character is sent, so all keyboard responses slow down in direct proportion to code speed.

Switching between code speeds is done by inserting special control characters in the identifier (or message) you want to transmit. "Fast" code is sent until the software encounters a "<" character in the ID or message string. Then it remains in slow mode until it sees a ">" character. For example, the default ID string in the configuration file is "FAST <SLOW>". It will send the word "fast" at 12 WPM and the word "slow" at 5 WPM. When setting up an ID or message file, I suggest NOT putting any spaces between the speed control characters and the slow
text, because the space will also be sent at the slow speed and produce a long silent period. Any spaces you want between the fast and slow text should be put at the beginning and end of the fast text. The control
characters themselves will not print on the screen as the message is being sent, and do not show up in the timing of the transmitted message.

What happens if you don't insert any control characters in the message or identifier? The program stays in the fast mode. What if you insert a "<" but don't put in a control character to switch back to fast mode? It sends everything in slow mode after the first pass.

Changing code speed is done in the same way as with the original BCN software, except that when you press the "C" key, you will be asked to enter two speeds instead of one, with the speeds separated by commas. For example, to set up 12 WPM and 0.4 WPM, you would type 12,.4 in response to the prompt. You must enter two numbers even if you don't want to send slow CW. Of course, both numbers can be the same.

If you want to generate 15 minutes of fast identifiers, it's gonna take a lot of repetitions. For example, JDH(space) takes exactly 4.0 seconds at 12 WPM, so it would need to be repeated 15 times for each minute of fast code. The easiest way to generate a long message like that is to use a text editor such as Notepad, copy and paste to generate many repetitions, save the file and then use the R command within the beacon program to read it. You would have to re-load this file every time you run the program -- I don't know the limit on the ID string length that you can save in the configuration file, but it's far short of 15 minute's worth at 10 or 12 WPM. The slow part is easier, since each repetition of an ID takes much longer. Using the same example as for the fast mode, JDH(space) at 0.4 WPM takes exactly 2 minutes.