Morse Trainer in Quartus Forth

General Description

I wrote my morse trainer program in Quartus Forth, which is Forth implementation for PalmOS 3.0 and higher. Main reason why I chose Forth was that it was available for free (trial version). I have had some experience with Forth from the eighties; this was also important.

The program consists of two files: morse-table.txt defines encoding table. The other, morse.txt, contains definition of the words.


Basic Words

MS ( n -- )
This word is a re-definition of Quartus' MS word, which makes a pause of n milliseconds. There is a bug in older versions of Quartus, which sometimes (quite often) causes your Palm to hang indefinitely.
Unit! ( n -- )
Sets basic element duration in milliseconds. "Basic element" is duration of a "dot" or the space between two sounds within a morse character.
Unit@ ( -- n)
Reads current basic element duration. There is a variable UNIT behind both these words.
Hz ( n -- )
Sets the beep tone to n Hz. (Hertz is a unit of frequency, s-1). This word should be perhaps spelled as Hz! to keep conventions, but I gave it this name and so far did not decide otherwise.
Hz? ( -- n )
Similarly to the previous word, this reads current value of the beep tone frequency. As above, it should be spelled differently, such as Hz@. Variable TONE is behind both these words.

Useful Words

PARIS ( n -- )
Calculates and sets basic element duration using PARIS method.
CODEX ( n -- )
Calculates and sets basic element duration using CODEX method. 300 PARIS is the same speed as 250 CODEX, I think.
WPM ( n -- )
Calculates and sets basic element duration using WPM (words per minute). Although I cannot swear that my assumption was correct, WPM speed is defined as number of CODEX groups (words) per minute. Therefore speed in CODEX equals WPM*5. If anybody knows if this is right (or wrong), pls let me know.
csend ( addr u -- )
Transmits counted string in morse at the defined speed and frequency, using Palm's beeper as output device.
ssend ( addr -- )
Transmits counted string stored at address addr in morse.
zsend ( addr -- )
Transmits zero-terminated string in morse.
>morse ( c1 -- c2 )
Converts ASCII character c1 to its binary morse code c2. If c1 does not have morse equivalent, c2 is 0.
CW. ( c -- )
Transmits character c in morse.

"Practical" Words

QBF ( -- )
Transmits "QUICK BROWN FOX JUMPS OVER THE LAZY DOG 1234567890 =?/.-+"
CQ ( -- caddr )
Leaves address of counted string "CQ CQ CQ" on TOS.
+K ( -- caddr )
Leaves address of counted string "PSE K" on TOS.
Tcvr ( -- )
This is a loop which prompts cw>, waits for 1 line input (max. 85 chars) and then transmits it in morse. Exits after input of empty line. Within this word you cannot (at least in the current version) change speed or beep frequency.

Copyright © 2001, Jindra Vavruska (OK1FOU). All rights reserved.