The AVR MINI-Keyer

By Murray Greenman ZL1BPU

Description of a simple keyer for HF and VHF beacons. Also useful for hidden transmitters. What makes the keyer different is its versatility - it is a multi-mode unit, with ASK and FSK modulation, able to send Feld-Hell and Morse on command. The message is easily changed.


Specifications     Keyer Schematic     Keyer Commands     Purchasing Details

WHAT'S IN THE KEYER?

Just two ICs - a tiny 5V regulator, and a small micro-controller. There are a few transistors used to switch and control the rig and create the RS232 interface used to program the Keyer and provide telemetry. Other than that, just a few resistors, capacitors, connectors and a cheap crystal. No more than $30 worth of parts.

Note how small the prototype keyer is (shown on the right, click on it for a larger view). Only 50mm long! The connector at the top is used to initially program the unit, and serves as a handy place to put the link which prevents the message from being overwritten (link is yellow). The connector on the right is the RS232 connector where new messages can be sent without reprogramming, and where the telemetry is sent.

With all surface mount components, the unit could easily be as small as 40 x 20mm. No PCB is available, so if you make one that others could use, please let ZL1BPU know. With through-hole components, the unit could still be smaller than 40 x 60mm.

WHAT THE KEYER DOES

The keyer controls the carrier (PTT) of an AM or FM transmitter, or the PTT of an SSB transmitter. It can also key data onto the PTT, e.g. for MCW transmission, or to key a CW transmitter. It also (independently) keys audio tones used to modulate the transmitter. Hence you can use it to turn the transmitter on, generate quiet carrier, modulated carrier, identification sequences, send telemetry data and silence with carrier off. With an SSB transmitter the "quiet carrier" concept does not exist. The unit is able to:

Morse code is an obvious choice for a beacon, since is is universally understood, provides good performance at low power, is simple to transmit and to understand. But why Hellschreiber (Feld-Hell)? Well, Hell is also a very simple mode, since it is also on-off keyed like Morse. Hell is also "human readable", but by eye rather than by ear.

With Hellschreiber it is also possible to monitor the signal for long periods without effort, and record the data as a graphics file. Hellschreiber is also very robust and works well in noise at relatively low power. The transmissions are only about 250 Hz wide.

PACKET RADIO

The packet radio option adds flexibility. As each message "frame" is completed, the same message is sent via the serial port, and can be used with a packet TNC to send UI frames. With the right message preamble, APRS format would be possible.

Keyer messages can be created off-line and sent from file. By making a connection to a TNC connected to the unit, with the right setup and a slight code adaptation, telemetry message updates could be sent at any time.

BEACON CONTROL

Carrier-cut keying allows the keyer to be used with CW transmitters, for example QRP, LF and precision frequency transmitters. Although a QRSS (very slow Morse) mode is not provided, very slow Morse can be synthesized by generating carrier sections in 2, 4, 8 or 16 second building blocks.

Subcarrier keying (keying an audio tone modulated onto the transmitter) is more appropriate for VHF beacons. This unit will do both, and in addition has the option of transmitting subcarrier keying with carrier cut (as in MCW) or without carrier cut (the normal method). Normally (with subcarrier keying) the carrier is turned on at the start of the message and stays on until the message completes. The subcarrier tone is 980Hz, or exactly 8 cycles of tone per Hell dot.

The keyer will send both "Normal" and "DX mode" Feld-Hell, at the standard 122.5 bits/second, as well as half-speed, quarter-speed and eigth-speed. The slower speeds are less affected by multi-path, and are also less affected by noise. Slow speeds are no problem for beacon use, since little data is involved.

Morse code mode also has four speeds, about 20 WPM, 10, 5 and 2.5 WPM. These speeds were chosen for an important reason - they are "Hell compatible", in that the time of one dot is the same as the time for one column of Hell data. This means that the Morse can be "read" off the screen visually, and also means that the timing of the Hell mode is preserved, so the phase of the Hell text either side of a Morse sequence remains the same. The lower speeds can be read with great sensitivity by using a spectrogram technique. For very low speeds, such as is used for LF beacon operation, carrier segments can be pieced together as Morse characters.


Hell compatible Morse code telemetry
(it says DE ZL1BPU BCN 1/3FF 2/13F AR)

The single message can have a mix of all these modes. Telemetry can be sent in Morse as well as in Hellschreiber, and modes changed during the message. Outputs can also be controlled by the message, and used to change transmitter power or perhaps a choice of antennas or operating frequencies during the message. The message can be any length up to 120 characters (including commands). With a large message memory, and the multiple mode message flexibility, it is easy to create several messages to be sent in a sequence in different modes.

The message can be changed at any time, by removing a link and rebooting the keyer processor (momentarily removing power). Once the new message has been "learned", which takes just a few seconds, the keyer will start again, and once the link is restored, will remember the message forever, even if power is lost. (Remote programming is not possible with this feature - at present independent means to reboot the micro for reprogramming is necessary. If this feature is of interest, suitable changes could be made to the firmware).

The three telemetry inputs can be read and transmitted anywhere in the message, so for example text can be associated to add meaning - for example: "CHARGER 1 ALARM 0".

The message can contain a mixture of text, telemetry and commands, which are two character combinations starting with "$". For example "$1" is Hell mode (the default mode), $C sends the status of input PD4, and $7 turns on a digital output. And yes, "$$" sends the "$" character! Here's a typical message:

$1 ZL1BPU BCN $1 CHARGER $C ALARM $D $0DE ZL1BPU BCN  + ~
which will be received as (for example):
(Hell)ZL1BPU BCN CHARGER 1 ALARM 0 (Morse)DE ZL1BPU BCN AR

KEYER APPLICATIONS

The keyer has been designed as an HF / VHF beacon. It is set up to allow flexible messaging, and to provide switchable antennas, frequencies or transmitter power levels. It could be used for:

GENERAL DESCRIPTION

The keyer is based on an AVR AT90S2313 processor running at 3.58 MHz. Take a look at the Schematic, and see the Specifications for more detail. (Note that there are no Analog ports in this version, just the two digital outputs and four digital inputs). The external interface circuitry is not shown on the simplified schematic, but is the same as for the Super Keyer. The message is stored in EEPROM, and is independent of the program. The message can be up to 120 characters long, including text and commands, and can be changed any time using an RS232 serial cable and a terminal program. Messages can easily be hand typed, or can also be stored on disc and downloaded.

Any mixture of Morse and Hell modes can be used in the message. The format of the telemetry is completely free form. This is achieved through the use of a "command interpreter" which checks each character of the message for commands.

While the message is being transmitted, the same message appears at the RS232 port. Since the message on this port is terminated by <CR><LF>, the RS232 cable can be connected to a Packet Radio TNC so that the telemetry message is relayed by packet on VHF as well!

The font used is the ZL1BPU MOSAIC II 7 x 5 font, as can be seen in the following example. The slant is due to the 1% error in the microprocessor reference oscillator frequency, since corrected in software.


The ZL1BPU AVR Keyer in action

KEYER COMMANDS

KEYER SCHEMATIC

(click titles for link)

CHARACTER SETS

The following characters are supported by the keyer:

Hell Mode
ASCII characters 0x20 (32) to 0x5F (95) comprising the numbers, upper case letters, and the following punctuation:

(space) ! " # $ % & ' ( ) * + , - . / : ; < = > ? [ \ ] ^ _

Lower case letters and punctuation above 0x5F (if placed in the message memory) will be converted to upper case and the corresponding symbols by subtracting 0x20 (32) from the ASCII value. The Tilde "~" cannot be sent, as it is used to define the end of the message in record mode.

Morse Mode
Letters and numbers, plus the following punctuation and prosigns:

(space) " $ ' ( ) + , - . / : ; = ? _

The prosigns are + (end of message AR), - (Dash DU), = (Pause BT), and _ (Underline IQ). As with Hell, letters and punctuation above 0x5F will be converted within range where possible. Unsupported characters do not send anything, but will incur a two dot-element delay.

MESSAGE RECORDING

The message is made up using text and commands, (see KEYER COMMANDS) and stored as a file. The programming mode has no error correction, so if something goes wrong, or a bad command is sent, the process will need to be restarted. The file can be sent to the keyer using Windows Terminal or almost any other terminal program that supports 1200 baud, no parity, 8 data bits (1200N81).

There is no handshaking between the computer and the keyer. Communication is slow so that each byte can be programmed before the next byte is received. This avoids the need for a message buffer and the complex timing of programming and serial communication at the same time. Programming is reliable when the message is hand sent, or if it is preassembled and sent from the terminal program at full speed.

The PB7 input to the micro (Port B, bit 7, pin 19) has been selected to indicate when message recording is required. (This is one of the pins in the programming header). Normally this pin is held low by a link. If the micro is powered up with the link to ground in place, the micro interprets this as normal mode, and will start sending the message when power is applied. If the PB7 pin is left open when power is applied, the beacon goes into record mode, and stays there until it receives a "tilde" command (~), when it reverts to normal mode. If a mistake is made during programming, remove power from the keyer to allow the micro to reset. If you end up in programming mode inadvertently, the first character of the message will be erased, so you will need to send the message again.

As each character is sent and recorded, it is echoed back to the computer. Control characters will be stored and echoed to the computer during record, but are not sent by the beacon. Thus you can embed sequences which will not be transmitted. When the message is complete and tilde (~) has been detected, the keyer will send "73" as it reverts to normal mode. If the "73" is not received, the tilde was not detected. The tilde is stored as an end of message marker, but is not transmitted with the message.

Once the message is complete and the tilde received, the message transmission will start. At this point, check that the message is correct, and if you are happy with it, place a jumper from PB7 to ground, then remove and reapply power to check that the beacon operates correctly and has remembered the message.

Message recording only affects the user message, which is stored in electrically eraseable reprogrammable memory (EEPROM) in the micro. It has no effect on the microprocessor instructions, which are stored in the microprocessor program memory, and can only be changed with a special programmer. The Hell and Morse character sets are also stored in the program memory, in a 512 byte table.

WHERE TO GET THE FIRMWARE

It is possible to purchase just the executable code, or both the executables and source code. See the Micro Page for details.


Copyright Murray Greenman 1997-2005. All rights reserved. Contact the author before using any of this material.