HEATH Program to Set RT-11 Date and Time From Heathkit GC1000 Clock John M. Crowell U.C. Davis INTRODUCTION The Heathkit Model GC1000 digital clock is a short-wave radio receiver tuned to the National Bureau of Standards station WWV, which broadcasts the date and time-of-day on frequencies of 5, 10, and 15 MHz. The GC1000 decodes the time and date signal and displays the time on a digital display. An optional RS-232 module on the clock puts the time and date out in an ASCII string terminated by a carriage return. This program sets the RT-11 date and time from the ASCII string produced by the Heathkit GC1000 WWV clock connected to a DL11-type serial port. An in-line interrupt service routine scans the input data for a carriage return marking the end of a data "frame" and then stores characters in a buffer until a second carriage return is encountered. If a second carriage return is not found before the end of the buffer (which is, of course, large enough to accomodate the GC1000 data frame), an error will be generated, and the program will exit without attempting to set the time or date. The GC1000 may be set to either 12hr or 24hr mode. If no data appear on the serial port within a time-out period, the program will exit with an "off-line" error message. If the clock is running, but has not set itself, the program will exit with a "not-set" error message. If the clock is "set" but not locked, the tenths-of-seconds digit on the clock will be dim indicating that the clock time is not necessarily accurate. In this case, the program will exit with a warning message, and a WARNING level error will be generated. REQUIREMENTS The following hardware and software are required: Hardware: Any PDP-11 or LSI-11 processor System clock at 50Hz or 60Hz Any DL-11 type serial port. Heathkit GC1000 clock with RS-232 option Software: RT-11 Version 5.0 or later. CUSTOMIZATION The following locations can be patched to customize the program without rebuilding it. 1000 contains the base CSR for the serial port (defaults to 176500) 1002 contains the interrupt vector for the serial port (defaults to 300) 1004 contains the number of clock ticks to wait before assuming that there is nothing coming in the serial port, or that whatever is connected is not sending a "time frame" terminated by a carriage return. (defaults to 180. ticks, or 3 seconds with a 60Hz clock) 1006 contains a fine-tuning value. The ASCII output from the HEATH clock is delayed by about 1 second, which is taken into account by this program. The computation time to convert the ASCII string into RT-11 format date and time is processor dependent. A fudge factor can be inserted at this location which will be added to the number of clock ticks since midnight, to adjust for processing time. 1010 Error severity code for "fatal" errors. e.g. No input - "clock is off-line" Unable to protect interrupt vectors (another job has'em) Framing error - unable to sync to clock input (no ) 1012 Error severity code for "non-fatal" errors. e.g. Clock time is not set. Clock data frame is undecipherable If the program is run from a command file, patching these locations will affect the continuation of the command file, depending upon the current level of SET ERROR. SET ERROR LEVEL Value NONE WARNING ERROR FATAL SEVERE 0-1 cont cont cont cont cont (success) 2 cont abort cont cont cont (warning) 4 cont abort abort cont cont (error) 10 cont abort abort abort abort (fatal/severe) 20 abort abort abort abort abort (unconditional) WARNINGS and DISCLAIMERS This program uses in in-line interrupt service routine. When running under the XM monitor, it should be run only as a background job, so that there is no chance that the interrupt service routine will be in PAR1 or PAR2 and possibly be mapped away. The year in the GC1000 ASCII output is determined by switches inside the clock. (WWV only sends month and day.) The RT-11 date will be correctly set through the year 1999. Years 2000-2099 are to be supported in RT-11 beginning Version 5.5. This program uses the "preannounced" protocol for years 2000-2071. From 2072-2099, this program will not set the year properly. (If anyone is still using it by then, call me.) There is, however, no guarantee that the protocol used by this program will be the one finally established in future versions of RT-11. One can only hope.