Qst Article

From QST, May 1977, pp 35-37. Used with permission.

A Fully Automatic Morse Code Teaching Machine

How would you teach Morse code to a person? Probably you'd divide the characters into groups and send the same few signals repeatedly until learned -- sending "missed" characters more frequently. A microcomputer can provide the same individualized introduction to Morse code.

By Howard Cunningham, WA9VRU


There are many ways to learn the Morse code, most of which will work if given enough time and effort by the student. However, some techniques have been shown to streamline the learning process.[1] These include sound recognition and postponed discrimination. With the aid of both techniques, most students can reach proficiency at 5 wpm after six to eight one-hour sessions.

Sound recognition is perhaps the single most important instruction technique. Since the code is copied by ear, it must be learned by ear. Further, characters should be learned at a speed fast enough (approx. 15 wpm) to each each character as a single sound rather than a sequence of dots and dashes.

Postponed discrimination requires that longer characters be introduced to the student before shorter characters with the same element sequence. For example, C is introduced before K, which is introduced before A and T. This forces a student to listen to the entire letter before making any decision.

The first problem encountered by the student then becomes finding six to eight hours of good code-practice material. Most code records and tapes are one to two hours long, requiring repetition of material and practice with material both above and below the student's ability. An alternative is attending a good code class where new material is presented at a level in line with the overall ability of the class. In fact, very small groups are ideal, as the instructor can keep track of each student's proficiency and adjust the practice text accordingly.

I have taught Morse code for many small groups. It was while instructing a make-up session that I realized how mechanical my technique had become. While watching each student carefully, I would look for troublesome letters, concentrate on them until the student gained proficiency, then throw in some old letters for practice. If he could still copy satisfactorily, I would introduce some new letters. Then I realized this technique was a natural application for a microprocessor.

Programming the microcomputer to send code was no problem; Thomas and Belter discuss a code-practice oscillator program in their introduction to microprocessors.[2] The challenge was having the computer adjust to the student's ability.

The student would be required to copy on a computer keyboard. This did not seem too severe a restriction as even hunt-and-peck typing speeds are well above the rate characters would be sent. The computer could time response intervals in addition to testing for correct responses. Furthermore, the computer printing could be controlled to provide immediate positive reinforcement.

I wrote such an instructor program for the Motorola MC6800 microprocessor and tried it out on a few friends. The results were so encouraging that I doubt I will ever teach Morse code by hand again.

Theory of Operation

The microcomputer communicates with the student both aurally and visually (see Fig. 1). A speaker connected to the microcomputer is used to send individual Morse characters at 15 wpm. The character being sent can also be displayed visually on a video display screen for simultaneous sight and sound recognition.


Student input is thought the computer keyboard. Correct answers for characters sent are acknowledged immediately by displaying the character on the TV screen. Incorrect answers are simply ignored. It is important that the computer uses no negative conditioning for incorrect answers; if the student is unsure, he is encouraged to guess. A correct guess is a very satisfying response.

The teaching algorithm can be summarized in the following manner (see Fig. 2). The program works with a subset of the alphabet starting with the longer letters. One of these is selected at random, with preference given to troublesome letters.


The selected letter is sent as Morse code but not displayed on the screen. The computer then waits for a correct answer. If the correct response is not typed within a few seconds, the letter is repeated, both as Morse code and on the TV screen, and again the computer waits for a response. This step is repeated until the correct letter is entered by the student. The actual duration of each wait is adjusted based on previous responses and is slowly lengthened if no response is made.

When a correct response is entered, the computer will adjust an error probability estimate for that letter. If the student responded correctly, without being told in the previous step, the error probability estimate is reduced; otherwise, it is increased. If the student is still having trouble with any of the letters (i.e., some error probabilities are high), the program returns to select a new letter from the same subset of the alphabet. If, however, the student is doing sufficiently well with all of the letters introduced so far, one of the remaining letters is added to the subset. New letters are selected in a postponed-discrimination order (see Table 1). The initial error-rate estimates for this letter is 100 percent (worst possible) as it is assumed to be new to the student. This will cause a high concentration on the new letter until the student can reliably recognize it without the aid of the visual display.


The estimated error probability for each character is at the heart of the computer program. It represents the computer's immediate evaluation of the student's recent performance. This information itself can be of value to a student; therefore, a special function in the program will print a bar graph on the display terminal representing the amout of additional work needed for each letter.

Programming Details

In this section some of the implementation details of the program will be discussed. It will be of interest to those considering writing a similar program; others might skip this section for now.

The program was initially run on microcomputer system using the Motorola MC6800 CPU, 1/2 kilobyte of RAM and 1/2 kilobyte of monitor ROM. The program uses 350 bytes of memory for instructions and 90 bytes for data. The program communicates with a video terminal through an ACIA (UART). A mechanical terminal could be substituted if its noise did not interfere with the code reception. Only one bit of programmable output is required for the Morse code. Parallel output ports are well suited for this although the original implementation used the RTS modem signal of the ACIA. A 1000-Hz square wave is generated on this line so only a single transistor or TTL gate is required to drive the speaker. Interrupts are not used; all program timing is done with a delay loop in a subroutine.

Data structures used by the program include three tables, ERROR, MORSE and ASCII (see Fig. 3), all of which are indexed by a selected character number. The ERROR table contains the estimated probability of error for each character. Each element ranges from zero for zero percent to 255 for 100 percent. The zeroth element of the table contains an average error rate over all characters. The other two tables contain the Morse code and ASCII (teleprinter) code for each letter. Both are required because the tables are sorted into the postponed-discrimination introduction order.

Character selection is based on the ERROR table as follows: a random number ranging from one to 32767 is generated from a pseudo-random sequence. The program then cycles through the ERROR table subtracting each probability from the random number. The character that corresponds to the element which finally counts the number past zero is selected. The larger error probabilities are naturally more likely to push the counter past zero and thus cause the more troublesome letters to be selected.

The dots and dashes of each Morse character are encoded into an eight-bit byte as a string of zeros and ones respectively.[3] An extra one bit is added to mark the end of the character. As the code is being sent, the bit pattern is shifted once for each dot or dash (the bit shifted out indicates which) until only the single extra bit remains. A dot is sent for 80 milliseconds, a dash for three times that. A 1000-Hz tone is generated during this time by complementing the single output bit every 1/2 millisecond. Any keyboard entries typed while the character is being sent are discarded.

While waiting for a correct response, the computer counts the response time in 20-millisecond units. Using eight-bit arithmetic, this places an upper limit of about five seconds on delays. The program waits for twice the average response time before giving up on a correct response. The average is computed as 7/8 of the previous average and 1/8 of the most recent response time. This weighted average permits the program to adapt to widely varying typing speeds but prevents sudden changes with a lucky guess on a single character. If no correct response is entered, twice the average is used in the computation resulting in a delay increase of about 12 percent.

The error probabilities are also adjusted with a weighted average of 7/8 of the old value and 1/8 of the new value. The new value is zero (perfect) if the correct response was entered without help from the microcomputer. A new character is added only when all individual error rates are less than 40 percent (indicating no major problem areas) and the overall error rate is less than 30 percent (indicating a satisfying, but challenging performance level for the student).

The carriage-return key is used to request a bar graph display of the error-rate estimates. A hard-copy printout of this graph at the end of each practice session provides a very positive indication of progress for the student. Sending does not resume after the graph is displayed until a second carriage-return is typed, thereby giving the student a chance for a break.


From early experience with the Morse teaching program, some points have become clear. Regular practice is important, although it makes little difference whether the practice is once a day or once a week. Practice periods of one to one-and-one-half hours are about as long as are useful. Longer sessions cause performance on previously well-known characters to drop. Of course, the program recognizes this drop, and will not introduce any new letters.

The student may feel he has forgotten everything since the last session. But the program will start over at the beginning to review the letters learned previously. Each session turns out to be divided roughly in half between practice of previously introduced letters and introduction of new letters. Note that there is nothing in the program that distinguishes between review and new letters. Its behavior is dictated solely by performance in the current session.

The program introduces new letters to keep the student copying at about 70-percent correct. The number of letters added in a single session is a good indication of progress. In fact, once all letters have been introduced, there is little the program can do other than building up a little speed. Speed itself is limited to 8 to 10 wpm because a response is required before continuing. About 10 wpm some other form of practice is needed, permitting the student to copy several characters behind. Indeed, above 15 to 20 wpm random text is of questionable value as syllable and word recognition become important. In other words, the program will take a student from ignorance of the code to a Novice ticket, but a different type of practice will be required for the General, and possibly a third type for the Extra.

One positive consequence of the 10-wpm limit is that no student will become too dependent on a keyboard to copy code. At 8 wpm the transition from "mill" to pencil is not at all difficult.

The success of the Morse code teaching program is dependent on three very important concepts: reinforcement, adaptively and automation. The student is reinforced for correct answers by character echoing and for total improvement by the bar-graph display. When one still does not know enough code for a complete sentence, it is very reassuring to see new letters being chalked up on the bar-graph display every session.

Adaptively is even more important as it is the concept upon which the program was built. The program is adaptive n three respects: character selection, character introduction rate and typing speed. Although the student may be unaware of the internal program operation, he will develop confidence in the program to maintain a good pace without pushing too hard. This leads to the third point, automation.

The program must work automatically. It is unreasonable to expect the student to know anything at all about the program or about computers in general. The instructions for use are simply, "Try to type the letters before the computer does." The student can figure out the rest.

Where can one get access to a machine to run the Morse code instructor program? Those who already have a microprocessor system have only to obtain a version of the program for their machine, or convert a copy of one of the existing programs for their system. Those considering building up a machine can add this to their list of possible applications.

Amateur radio clubs, particularly those with training programs or operating stations, could well consider maintaining a microcomputer specifically for Morse code instruction. The Purdue Amateur Radio Club has installed such a system and, although eh club intends to use the machine for other applications, code instruction will have a first priority. The club has continued its regular code classes, but has tailored them so students can switch freely from classroom to computerized instruction. The service has been indispensable for those who get behind or want to get ahead.

Since beginning this project, I have become convinced that microprocessors can have some real applications in amateur radio. In fact, the teaching machine was an amateur radio project that happened to involve a microprocessor, and not the other way around. We should welcome the entry of the microprocessor into our hobby, particularly when it is solving problems with no previous solution.


[1] Harris. "Morse Decoded," QST, September, 1976.

[2] Thomas and Belter "Meet the Microprocessor," in three parts, QST for August, September and October, 1976.

[3] Krakauer, "Efficient Storage of Morse Character Codes," Byte, October, 1976.

[4] Erwood, "A New System for Learning Morse Code," 73, April, 1969.

See also scans of Original Qst Article, Historic Source Code.


Last edited August 3, 2008
Return to WelcomeVisitors