[net.ham-radio] More on Moore code

die@frog.UUCP (Dave Emery) (02/27/85)

	In answer to a question about Moore code transmissions on hf
radio, I understand that there are still a few of these ARQ circuits
in use, particularly by eastern block countries to and from Cuba.

	Most are diplex (which is to say they transmit two channels
of traffic bit wise interleaved in a crude form of time division
multiplexing) and all are full duplex point to point circuits.  
	
	Moore code transmissions are isochronous self synchronizing bit
streams consisting of bit interleaved (alternate bits from channel A
and channel B) 7 element characters.  Each character has exactly 3 mark bits
and four space bits, making it possible to detect mutilated characters with
any single bit error and many multiple bit errors.  In order to
make it possible for a receiver to distinguish channel A from B
some of the characters are sent inverted (one's complement) with
a different sequence of inversions used on channel A than on channel
B.  This pattern of inversions repeats every 8 characters, the channel
A sequence is (IINI), while the channel B sequence is (INNN), the
resultant sequence is abaBABaB (capital=noninverted=N).

	Moore code characters consist of all 35 possible combinations
of 3 ones and 4 zeros, 32 of those combinations map into the 32 possible
characters of Baudot (Murray) code (most conventionally the CCITT 
alphabet #2 assignments), and the other 3 are used for error control
and idle state indication.

	In the past (1971) I copied Moore circuits running at 96 baud,
or slightly faster than the 94.34 baud rate that it would take to
encode two 50 baud 7.42 element code Baudot circuits.  There were a
few circuits running at 192 baud with 4 channels in use then, I do not
know whether there are any still around. I suspect that
many Moore circuits in use now still use these rates, but I haven't checked.
50 baud telegraph/telex circuits are a world standard. (A synchronous
Moore circuit would have to run slightly faster than an incoming Baudot
circuit to compensate for time wasted on retransmissions and allow for
slight speed errors in the sending Baudot equipment, thus my memory of 96
baud seems right.)

	All standard Moore circuits use ARQ protocol, which is to say
that if the receiver gets a character in error it asks the transmitter
to resend the character in error by sending a special character (the RQ
or Signal I).  The transmitter then resends the character, if I remember
correctly along with a special idle character to mark the retransmission.
This cycle repeats until the character is received with correct parity
by the receiver.  Since something must be sent when there is no traffic
an idle signal is transmitted if no character is available from the incoming
line. A different idle is transmitted if the other end of the circuit has
lost sync. (Idlea alpha and beta). My memory of all of this
is a bit hazy, but I think most Moore circuits are go back 2 ARQ, which
is to say that they retransmit the character sent two characters before the
one being sent when they see an RQ.

	HF transmissions carrying Moore traffic are mostly single channel FSK
400/425 hz shift, although fdm multiplex Moore transmissions with channels
240 hz apart were used in the past (among other things to carry
a backup circuit for the Moscow-Washington hotline).  They can be received with
a general coverage receiver and any ordinary FSK converter such as AEA CP-1.  

	Recovering traffic from a Moore signal requires some additional
hardware or software or a combination of both beyond what is needed to
recover normal Baudot or ASCII.  The required functionality is some
means of phase locking to the incoming bit stream, and recovering timing and
sampling each bit at the center of a bit cell (baud).

	This can be done on a microcomputer system by a real time clock driven
interrupt routine (software phase lcoked loop) that samples
the incoming digital signal every tick of
say a one millisecond real time clock and from those samples computes
which sample is closest to the center of a baud, and exactly how many ticks
and fraction of ticks a baud is and so forth.  Such a routine is not difficult
for an experianced real time programmer to write, and many micro systems have
suitable real time clocks.  Probably such a routine would have to be in
assembly language because of the relatively tight timing on a slow
microcomputer.  A number of AMTOR programs (which handle a very similar
signal) use this technique, and if one should have source of one one
probably could easily modify it to lock onto Moore transmissions.  I
understand that software phase lock loops have also been used for packet
radio AX-25 HDLC recovery so such code may be in the public domain somewhere.

	The other method of recovering timing is to use one of the
bit-synchronous USART chips which have integral digital phase lock loops to
lock onto the signal.  My favorite (we use it at CRDS) is the Zilog
8530 SCC.  This chip can be programmed to recover 7 bit characters and
to lock onto the bit stream given an approximate baud rate.  With
clever programming it ought to be possible to start the SCC chip at the
beginning of a character (by trial and error) so that it delivers a stream
of 7 bit characters directly (or halves of 14 bit diplexed characters).

	Recovery of the information once one has a stream of bits
(or characters) requires software that acquires lock onto
the 4 marks/ 3 spaces framing of a character, detects the channel A and
B inversion sequence (in case of diplex - the most common case) and
translates the characters from Baudot code to ASCII and prints
or displays them.  This software is not very hard to write, and could
probably be done in some higher level language for a micro, as there
are only about 13.5 characters a second to translate.

	This should deliver a readable copy of whatever was being sent 
(presuming it's not encrypted).  It should be a slightly corrupt copy
because of occasional go-back-2 retransmissions. I suppose that it is
possible to eliminate some of those retransmitted characters by statistical
filters based on the probabilities of pairs of identical characters being
part of the text or retransmissions, but for casual curiosity that seems
overkill. (Or one could monitor both sides of the circuit if one had
the equipment and were suitably located).

	It is possible to build hardware to do all of this - I
did so in 1971 using TTL SSI and MSI - but in this day and age one
would have to be more than slightly crazy to try.   It is also possible to
use a microcomputer on a chip such as the Intel 8096 to do all of the
work (it has nice counter timers and even a DPLL) and build a few chip micro
system that takes the TTL or RS-232 output of a FSK converter and
translates it and puts it out as ASCII on a RS-232 port.  In general
my advice would be to use an existing microcomputer system with minimum
hardware (a real time clock if one isn't already provided, and a readable bit
connected to the FSK converter) and do it all in software.

	I would be interested in hearing what turns up on Moore, someday
I am going to dig into the tty driver of the Charles River UNIVERSE
system on which I am typing this and make it receive Moore transmissions
(and blow the dust off my HF receivers in the process) but I haven't gotten
around to doing it yet ...


	Appendix

	The following is a Moore to Baudot table taken from 
	"Reference Date for Radio Engineers"  Howard W Sams 1975 p 35-40

Unshift	Shift	Moore	Baudot
------- -----   -----   ------
Null	Null	70	0
E	3	0E	1
Line Fd Line Fd	0D	2
A	-	2C	3
Space	Space	0B	4
S	'	2A	5
I	8	07	6
U	7	26	7
CR	CR	61	8
D	WRU	1C	9
R	4	13	A
J	Bell	62	B
N	,	15	C
F	!	64	D
C	:	19	E
K	(	68	F
T	5	51	10
Z	+	46	11
L	)	23	12
W	2	52	13
H	#	25	14
Y	6	54	15
P	0	29	16
Q	1	58	17
O	9	31	18
B	?	4C	19
G	&	43	1A
Figs	Figs	32	1B
M	.	45	1C
X	/	34	1D
V	=	49	1E
Ltrs	Ltrs	38	1F

	Control Characters

Signal I (RQ)	16
Idle  alpha	4A
Idle  beta	1A

Transmission order is LSB first.

-- 
          David I. Emery   Charles River Data Systems
983 Concord St., Framingham, MA 01701 (617) 626-1102 uucp: decvax!frog!die