From steveh@hpcvra.CV.HP.COM Mon Apr 30 18:54:12 1990 From: steveh@hpcvra.CV.HP.COM (Steve Harper) Newsgroups: comp.sys.handhelds Subject: Morse code practice for the HP48SX Date: 25 Apr 90 20:20:18 GMT Organization: Hewlett-Packard Co., Corvallis, OR, USA I have received a request to post the morse code practice program for the HP48SX which I wrote and placed on the HP BBS... So, here is the documentation with the program immediately following. Good Luck! Steve CW: A Morse Code Practice Program for the HP-48SX CW is a directory containing several programs and variables which comprise a capable Morse code practice system for the user. The program can send code using the beeper at speeds slightly over 20 words per minute continuously, without encountering delays due to calculator "garbage collection". The user can set the overall speed and element speed independently, or can manually set the timing and delay for each element type. The program will create, send, and display five character random code groups, or the user can store any size string in a variable to be sent and displayed manually. The following descriptions explain the programs and variables and their use. CGR (Code GRoups) is a program which creates a string of 25 five character random groups, sends them using the present speed parameters, and then displays them so the user can check his copy. The characters are selected from a string in CGR which contains all the characters and prosigns used in amateur radio license tests. If the user wishes to practice only certain characters, this string can be changed with 'CGR' RCL EDIT or 'CGR' VISIT and the groups will then include only the characters from the modified string. SPD (SPeeD) is a program which calculates and sets the various parameters affecting the timing of each type of element. The program prompts the user for the overall speed in words per minute and the element speed, also in words per minute. After entering these two numbers on the stack, the user presses [LSHFT] CONT and the program stores values in ST, LT, ET, CT, and WT. SPD will not signal an error if speeds are set too high or if element speed is less than overall speed, but one of the values in ST, LT, etc. will be set to zero or negative and CWO will halt or hang. Calculator speed and overhead as well as time to do the garbage collect operation limit the speed to slightly more than 20 wpm if overall and element speeds are the same. If the element speed is set faster than the overall speed, somewhat higher speeds can be reached, 26 wpm overall with 29 wpm element speed being about the maximum in any case. The speed will be quite accurate, within 1% or so in most cases. The user can measure the speed if desired by storing the string "paris paris paris ..." in TXT and using a stopwatch to time from the first element of a word to the same first element a few words later. Divide the number of words timed by the number of seconds on the stopwatch and then multiply that by 60 to obtain the speed in words per minute. CWO (CW Output) is the program which actually sends the Morse code using the beeper. CWO sends the characters contained in the string TXT. TXT is set and CWO is called automatically by the CGR program, but the user can set TXT and then execute CWO manually to practice something other than random code groups. DSP (DiSPlay) is a program which displays a screenful of characters from the TXT string. CGR calls this program to display the code groups it creates and sends. If TXT is more than one screen long, DSP halts after each successive screen. The user can view the next screen by pressing [LSHFT] CONT. TXT (TeXT) is a variable which contains a string which will be sent as Morse code by the CWO program. Any ACSII character with decimal code 32 through 128 can be contained in TXT. Characters that have no representation in Morse code will be sent as a space. Note that some of the radio prosigns which have no representation in ASCII have been placed on some of those characters. For a listing of these, see the CODE variable. Note that lower case characters are folded into upper case. CODE (CODE) is a variable which contains a list of short programs, one for each character. CWO disassembles this list on the stack before sending so that it can access the character codes much more quickly than by other methods. Prosigns which have no associated ASCII character are rather arbitrarily placed on the following characters: understood (SN) ! error (HH) # paragraph (AL) * starting signal (KA) [ wait (AS) \ end of work (SK) ] ST (Short Time) is a numeric variable containing the basic element (dit) time in seconds, normally set at 1.2/WPM. LT (Long Time) is a numeric variable containing the longer element (dah) time, set at 3*ST. ET (interElement Time) is a numeric variable containing the delay time between elements. This is generally set at the same value as ST, less the calculator overhead time between elements, .04 sec. CT (Character Time) is a numeric variable containing the delay time between characters. This is usually set to the same value as LT, adjusted for various calculator overhead times in the program. WT (Word Time) is a numeric variable containing the delay time between words. This is normally set to 7*ST, adjusted for various calculator overhead delays. FR (FRequency) is the frequency in hertz of the beeper. Set at 500 hertz, but the user may store any value which suits individual taste. S (Short beep) is a program which actually sends a single dit element. The user will not use this program. L (Long beep) is a program which actually sends a single dah element. The user will not use this program. W (Word wait) is a program which generates the delay for a space character. The user will not use this program. %%HP: T(3)A(D)F(.); DIR CGR \<< "" 1 25 START 1 5 START "+,./0123456789=?ABCDEFGHIJKLMNOPQRSTUVWXYZ]" RAND OVER SIZE * IP 1 + DUP SUB + NEXT " " + NEXT 'TXT' STO CWO DSP \>> SPD \<< "Enter overall wpm and element wpm, then CONT" PROMPT 1.2 SWAP / 'ST' STO ST 3 * 'LT' STO ST .04 - 'ET' STO 60 SWAP / 31 ST * - 19 ET * + 19 / 'WT' STO WT 3 * ET 4 * - .04 - .117 - 'CT' STO \>> CWO \<< CLEAR CODE OBJ\-> TXT 1 OVER SIZE FOR I MEM DROP DUP I DUP SUB NUM 29 - PICK EVAL CT WAIT NEXT CLEAR \>> DSP \<< 0 TXT SIZE 154 / FOR S IF S THEN HALT END S 154 * 1 + 1 7 FOR N 22 + TXT OVER DUP 22 - SWAP 1 - SUB N DISP NEXT 3 FREEZE DROP NEXT \>> TXT "PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS PARIS " CODE { \<< W \>> \<< W \>> \<< W \>> \<< W \>> \<< W \>> \<< L L S S \>> \<< L S L L \>> \<< L S S L \>> \<< S L L \>> \<< S S S L \>> \<< S S L \>> \<< L \>> \<< S S S \>> \<< S L S \>> \<< L L S L \>> \<< S L L S \>> \<< L L L \>> \<< L S \>> \<< L L \>> \<< S L S S \>> \<< L S L \>> \<< S L L L \>> \<< S S \>> \<< S S S S \>> \<< L L S \>> \<< S S L S \>> \<< S \>> \<< L S S \>> \<< L S L S \>> \<< L S S S \>> \<< S L \>> \<< W \>> \<< S S L L S L \>> \<< W \>> \<< S S S L S L \>> \<< S L S S S \>> \<< L S L S L \>> \<< L L S S \>> \<< L S L L \>> \<< L S S L \>> \<< S L L \>> \<< S S S L \>> \<< S S L \>> \<< L \>> \<< S S S \>> \<< S L S \>> \<< L L S L \>> \<< S L L S \>> \<< L L L \>> \<< L S \>> \<< L L \>> \<< S L S S \>> \<< L S L \>> \<< S L L L \>> \<< S S \>> \<< S S S S \>> \<< L L S \>> \<< S S L S \>> \<< S \>> \<< L S S \>> \<< L S L S \>> \<< L S S S \>> \<< S L \>> \<< W \>> \<< S S L L S S \>> \<< W \>> \<< L S S S L \>> \<< W \>> \<< L S L S L S \>> \<< L L L S S S \>> \<< L L L L S \>> \<< L L L S S \>> \<< L L S S S \>> \<< L S S S S \>> \<< S S S S S \>> \<< S S S S L \>> \<< S S S L L \>> \<< S S L L L \>> \<< S L L L L \>> \<< L L L L L \>> \<< L S S L S \>> \<< S L S L S L \>> \<< L S S S S L \>> \<< L L S S L L \>> \<< S L S L S \>> \<< S L S L S S \>> \<< L S L L S L \>> \<< L S L L S \>> \<< S L L L L S \>> \<< W \>> \<< W \>> \<< S S S L S S L \>> \<< S S S S S S S S \>> \<< S L S S L S \>> \<< S S S L S \>> \<< W \>> } ST .08 LT .24 ET .04 CT .043 WT .12 FR 500 S \<< FR ST BEEP ET WAIT \>> L \<< FR LT BEEP ET WAIT \>> W \<< FR 0 BEEP WT WAIT \>> END