Friday, July 12, 2019

RSX11 program to send morse code via the display register on PiDP11s and real PDP11s.


  I do a fair number of hobby projects here that need a microcontroller to run them. I usually use a vintage processor from the 70s - usually 6800s, and often the 6802, a 6800 that has on board RAM for a stack. Why? Because I read a lot about these processors  in the 70s, but didn't have the time to experiment  with them until relatively lately.

  Anyway, these sorts of projects are pretty minimalist - they don't usually have display or a terminal output. A way to see what's going on is needed during development and debug. An old trick of embedded developers is to use a spare IO pin to drive an LED, which is used  to flash messages about what's going on.

  I usually include this, and instead of just flashing the LED a number of times to communicate during debug, I use a routine that allows it to blink messages in Morse code. This allows me to easily communicate more complicated messages about what's happening than just counting flashes would.

  Like I've mentioned in previous posts, I've been doing a lot of work with my PiDP11/70 - an 11/70 emulator with a front panel. It occurred to me that having this capability on it would be useful when doing work where it is not practical to print a message to a terminal.

  I "translated" the routine I use on 6802s to MACRO-11, as a subroutine, MORSE.MAC. Subroutine MORSE is called with up to four arguments.

R0 - length of string to send
R1 - address of string to send
R2 - sending speed in ticks/element (default is 20)
R3 - LED(s) pattern to use (default is bit 0)

  If R2 or R3 are 0, then the defaults are used. If R2 or R3 specify a value, it is "sticky" - it becomes the default for future calls that have R2 or R3 0.

morse.mac


OK, so now I have a routine to call. But, I figured a program to demo the subroutine is in order, so I wrote MORDEM.MAC (stands for MORse DEMo). MORDEM is just the standard GMCL and CSI gingerbread used by just about all RSX utilties. It accepts a filename as input, and then uses MORSE to send the contents of that file to the display register, in morse code. You can enter TI: as the file argument, and it then takes input from the keyboard.

mordem.mac

To use
>mac mordem=mordem
>mac morse=morse
>tkb
TKB>mordem/pr=mordem,morse
/
task=...mse
libr=fcsres:r0 (or suplib=fcsfsl:sv)
//

Since this is a privileged task, address space is at a premium - and FCS
uses a lot of space.

Use FCSRES or FCSFSL in the taskbuild to conserve address space, or everything won't fit, and when you run it you'll get the message below...and it won't work.
INS -- Warning - privileged task not mapped to I/O page

>run mordem
MSE>ti:      (TI: for input from keyboard - or enter a file spec)
TEST STRING INPUT
SECOND LINE
ETC
^Z

The text entered, from  the keyboard will be blinked out on the display register as morse code.

Or specify a file
>run mordem
MSE>testfile.txt
>

Or install it and do it MCR command line style
>ins mordem
>mse testfile.txt
   or

>mse ti:

  You know, all the usual stuff.

  MORDEM supports a couple of switches...

    /SPE - specify the length in ticks of one element. 20 is the default.
    /LED - specify the bit pattern to blink. Bit 0 is the default.

1 comment:

  1. Lee,
    As usual a very interesting macro program to read through and learn from. This is the sort of program that would go well in a text book. Unfortunately, I never learned Morse code past SOS which the PiDP-11/70 did nicely. I could see that this would make a great trainer. I've thought about taking up HAM radio when I retire and this could come in handy.

    Thanks!
    Mark

    ReplyDelete

Comments?