Академический Документы
Профессиональный Документы
Культура Документы
;
;THIS SUBTROUTINE OUTPUTS ONE BYTE FROM THE CHARACTER BUFFER TO
;THE TELETYPE INTERFACE. THE BYTE CONSISTS OF B0=START BIT=0
;B1-B5 = BAUDOT CHARACTER, AND B6=TTY STOP BIT=1.
;
BAUDOT
STX XTEMP
;SAVE CHARACTER POINTER
LDX #PREGA
;POINT TO OUTPUT REGISTER
LDAB #1
;SET INTERVAL COUNT TO 1
BSR TIM1
;WAIT FOR START OF NEXT 1MS INTERVAL
;1MS WAIT PLUS THE STOP BIT 30MS (BELOW)= THE REQUIRED 31 MS
STAA 0,X
;PUT BYTE TO PIA OUTPUT REGISTER.
;THIS PUTS THE START BIT ONTO PA0 OUTPUT LINE AT BEGINNING OF
;A 22 MS INTERVAL
LDAA #6
;INITIALIZE BIT SHIFT COUNTER
SHIFT
LDAB #22
;SET TIMEOUT TO 22MS
BSR TIM1
;HOLD OUTPUT FOR 22MS
ASR 0,X
;PLACE NEXT BIT ONTO OUTPUT LINE
DECA
;DECREMENT BIT COUNTER
BGT SHIFT
;KEEP SHIFTING UNTIL DONE
LDAB #30
;HOLD STOP BIT 30MS
BSR TIM1
LDX XTEMP
;RETRIEVE CHARACTER POINTER
RTS
;AND RETURN FROM BAUDOT
;
;THIS SUBROUTINE COUNTS INTERVALS OF THE 1MS TIMER LOCATED
;ON THE TTY INTERFACE BOARD.
;
TIM1
TST 0,X
;CHECK IF PA0 IS LOGIC 1
BMI TIM1
;PROCEED WHEN IT GOES TO 0
TIM0
TST 0,X
;CHECK IF PAO IS LOGIC 0
BPL TIM0
;PROCEED UPON 0 TO 1
DECB
;COUNT DOWN AT 0 TO 1
BNE TIM1
;KEEP COUNTING DOWN UNTIL DONE
RTS
that had gone bad in his old computer system. He said they were
susceptible to tin whiskers due to their age. The blown fuse
occurred right after the teletype printed the character &,
which is figures mode G. The printer was in figures mode when
it failed to receive the LTRS command correctly, before a
transmitted ABCDEFGHI sequence. The figures mode H is a MOTOR
STOP command. But since it was immediately followed by another
transmitted character, it attempted to restart before it had
completely stopped. I have concluded that this transient motor
condition caused an AC line current spike that blew the fuse.
Oddly, the computer interface parts failed at this very instant.
I have not been able to figure out why. The only thing I can
think of is that I have the "minus" side of the 60mA current
loop line tied to microcomputer ground on the computer interface
card. This should normally be OK.
After replacing the fuse, the 7406, and the 2N2222A, all is
working again, just as it was before the incident. I should
probably implement the new opto-isolator-based design that I
discussed earlier so that there will be no electrical path
between the teletype sets current loop and the computer.
This incident points out that it is possible for the printer to
be in figures mode when the computer thinks it is in letters
mode. I am updating my ASCII-to-BAUDOT conversion table to
define two of the ASCII command codes, DC2 and DC4, to
explicitly send the LTRS code and FIGS code, respectively.
April 8, 2015- The DC2 and DC4 command codes work fine. I
modified my software to send a header string to the teletype set
before sending a text file. The header string consists of
0,0,0,0,<DC2>,0,<DC2>,0,<CR>,<LF>. This header works great, so
far. There have been no print errors since I started using it.
I can now send ASCII text files from MacTerminal to the teletype
set for printing, via the MC6800 computer. I demonstrated this
capability for Episode 4 of my Teletype set videos, which I
filmed today; TTY Video Demo
--------------------------------------------------------------June 14, 2015- Over the past year I developed modifications to
the interface circuit so that 1)the polarity of the current loop
connection will not matter, 2) the current loop is electrically
isolated, and 3) a circuit for receiving data from the teletype
set is added.
10
11