Documente Academic
Documente Profesional
Documente Cultură
by Random73
June 29, 2015
I do not have an oscilloscope, so I wrote a program for my
MC6800-based microcomputer to capture samples of the 60ma
current loop during signaling by the keyboard or the tape reader,
in order to measure any bias or end distortion that might be
present. I have never before had a capability to make any such
measurements on this teletype set, or any other set.
The program waits for a mark-to-space transition and then
samples the loop until the sample buffer is full (7935 samples).
Version 3 of the program simultaneously samples the output of
the 1 millisecond timer on the TTY interface card. After filling
the sample buffer the program dumps the buffer to the MIKBUG
console terminal, for porting into Microsoft Excel 2010.
1. Version 1 Testing June 17, 2015, Results
With version 1 I used MIKBUG Punch command to save the sample
buffer after a capture. Today (June 27) I reloaded the buffer
from the portions that I had saved on the 17th, and then ran
just the dump portion of version 3 so that I could plot the data
in Excel.
Keyboard Capture of June 17, Letter "R";
I forgot to use the REPEAT key, so the stop bit intervals are
longer than 31ms. Reacall that the keyboard data of June 17
showed glitches. No keyboard "glitches" occurred in this capture.
Samples 2-1251 cover 6 bit periods, should span 132ms;
132/1250 = 105.60us per sample, or 9.47ksps.
Keyboard Mark Interval Durations:
Sample 416 through 629 214 samples = 22.60 milliseconds
Sample 831 through 1051 221 samples = 23.34 milliseconds
Keyboard Space Interval Durations:
Sample 630 through 830 201 samples = 21.23 milliseconds
Sample 1052 through 1251 200 samples = 21.12 milliseconds
The bias distortion is now 6% marking bias (worst case), so I
over-adjusted the keying contact.
The first and third mark pulses did not glitch. This glitch
thing is a real mystery, especially since it is happening
intermittantly on both the keyboard and the tape reader.
4
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
001
DISTORTI
NAM
OPT
DISTORTION
O,S,NOG
TESTER V3
*
* JUNE 26, 2015 BY D.R.SENTZ
*
* THIS PROGRAM SAMPLES THE CURRENT LOOP BEGINNING AT
* THE 1ST DETECTED MARK-TO-SPACE TRANSITION, WHICH
* NORMALLY INDICATES THE BEGINNING OF A START BIT. I
* ESTIMATE THAT THERE SHOULD BE ABOUT 220
* SAMPLES PER BIT PERIOD (22MS), UNTIL THE MEMORY
* BUFFER IS FULL. SAMPLES ARE STORED BEGINNING AT
* THE HIGHEST ADDRESS OF THE BUFFER.
* UPDATE V3: ADDED SAMPLING OF THE 1MS TIMER OUTPUT
* AND BOTH SAMPLES STORED TO SAME MEMORY LOCATION.
* ADDED DUMP OF SAMPLE BUFFER TO CONSOLE AFTER
* BUFFER IS FULL, IN FORMAT
*
<CR><LF>LOOPSAMPLE,TIMERSAMPLE
* THIS FORMAT ENABLES EASY PORT TO EXCEL 2010 FOR
* PLOTTING AND ANALYSIS.
*
1EFF
EOBADR EQU
$1EFF
8008
PIA
EQU
$8008
PIA ON MEK6800D1 CPU BOARD
A048
RESTRT EQU
$A048
E07E
PDATA1 EQU
$E07E
STRING OUTPUT SUBROUTINE
E1D1
OUTEEE EQU
$E1D1
CHARACTER OUTPUT SUBROUTINE
E0E3
MIKBUG EQU
$E0E3
MIKBUG REENTRY POINT
*
1F00
ORG
$1F00
1F00 CE 8008
LDX
#PIA
*
* CONFIGURE PIA REGISTERS A AND B
*
1F03 4F
CLR A
INIT PIA REG. B
1F04 A7 01
STA A 1,X
POINT 8008 TO DDRA
1F06 A7 03
STA A 3,X
POINT 800A TO DDRB
1F08 86 FE
LDA A #$FE
REG.B B7-B1=OUTPUTS, BO=INPUT
1F0A A7 02
STA A 2,X
PUT TO DATA DIR. REG.B
1F0C 86 7F
LDA A #$7F
REG.A B7=INPUT, B6-B0=OUTPUTS
1F0E A7 00
STA A 0,X
PUT TO DATA DIR. REG.A
1F10 86 04
LDA A #4
POINT TO I/O REG.
1F12 A7 01
STA A 1,X
8009 IS PIA CONTROL REG.A
1F14 A7 03
STA A 3,X
800B IS PIA CONTROL REG.B
1F16 86 01
LDA A #1
NOW OUTPUT A MARK SIGNAL TO
1F18 A7 00
STA A 0,X
CLOSE THE TTY CURRENT LOOP
*
* WAIT FOR MARK-TO-SPACE TRANSITION ON LINE.
*
1F1A A6 02
WAIT
LDA A 2,X
SAMPLE THE LINE STATE
5 C
1F1C 26 FC
BNE
WAIT
IF MARK, WAIT FOR SPACE
4 C
1F1E CE 1EFF
LDX
#EOBADR ELSE INIT BUFFER POINTER 4 C
*
1F21 F6 8008 NEXT
LDA B PIA
SAMPLE THE TIMER STATE
4 C
1F24 C4 80
AND B #$80
MASK ALL BUT INPUT BIT
2 C
1F26 1B
ABA
MERGE; A=A+B
2 C
--PAGE
002
DISTORTI
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
1F27 A7 00
1F29 09
1F2A 27 0C
1F2C C6 06
1F2E 5A
1F2F 27 02
1F31 20 FB
1F33 B6 800A
1F36 20 E9
1F38
1F3B
1F3D
1F3E
1F40
1F41
1F42
1F44
1F47
1F48
1F4A
1F4B
1F4C
1F4E
1F51
1F54
1F57
1F5A
1F5D
1F5E
1F60
1F63
1F66
CE
A6
36
84
48
48
8B
B7
32
84
49
49
8B
B7
FF
CE
BD
FE
09
26
CE
FF
7E
1EFF
00
1F69
1F6B
1F6C
1F6D
1F6E
1F6F
0D
0001
2C
0001
04
0002
01
30
1F6B
80
30
1F6D
1F6F
1F69
E07E
1F6F
DB
1F00
A048
E0E3
STA A 0,X
SAVE SAMPLES IN ONE LOC. 6 C
DEX
4 CYC
BEQ
DONE
4 CYC
* VARY THE ARG. BELOW TO ADJUST SAMPLE PERIOD.
LDA B #6
SETS SAMPLING RATE
2 C
*
*WAIT LOOP BELOW IS 10 CPU CYCLES. I WANT ABOUT
*220 SAMPLES PER BIT (100US SPACING)
*
WLOOP DEC B
2 CYC
BEQ
CONT
4 CYC
BRA
WLOOP
4 CYC
*
CONT
LDA A PIA+2
GET NEXT LOOP SAMPLE
4 C
BRA
NEXT
AND KEEP GOING
4 C
*
* DUMP THE SAMPLE BUFFER TO THE CONSOLE USING
* <CR><LF> BETWEEN EACH SAMPLE. COPY/PASTE THE
* DUMP FROM TERA TERM WINDOW TO EXCEL, THEN
* SELECT THE DATA AND INSERT 2D LINE CHART
* TO PLOT THE SAMPLE DATA.
*
DONE
LDX
#EOBADR INIT BUFFER POINTER
OUTLP LDA A 0,X
GET SAMPLES
PSH A
AND A #1
MASK ALL BUT LSAMP
ASL A
ASL A
QUADRUPLE IT TO 4
ADD A #$30
CONVERT TO ASCII
STA A LSAMP
PUL A
AND A #$80
MASK ALL BUT TSAMP
ROL A
ROL A
PUT IT IN LSB
ADD A #$30
CONVERT TO ASCII
STA A TSAMP
STX
XTEMP
LDX
#OSTRNG
JSR
PDATA1
LDX
XTEMP
DEX
DECREMENT POINTER
BNE
OUTLP
IF >0 THEN KEEP DUMPING
LDX
#$1F00
SET UP PROG RESTART ADDRESS
STX
RESTRT
JMP
MIKBUG
AND EXIT
*
* DEFINE OUTPUT PRINT STRING
*
OSTRNG FCB
$0D,$0A
LSAMP RMB
1
FCC
/,/
TSAMP RMB
1
FCB
$04
EOT
XTEMP RMB
2
NOT THE SAME AS MIKBUG XTEMP
--PAGE
003
DISTORTI
00109
00110 A048
00111 A048 1F00
00112
*
ORG
FDB
END
$A048
$1F00
10
http://www.zippcast.com/video/a73d8b3f9842714ee97
An introduction and power up, March 2015
Episode 2
http://www.zippcast.com/video/a722081e609549512fa
Explanation of blown fuse at power up, and repair
Substitute circuit for 1/16 amp slo-blo fuse
Demonstration of tape reader and printer working
Episode 3
http://www.zippcast.com/video/bee7e30fdfdb47e24da
Keyboard "simultaneous mode" and reperforator
Keyboard contact bail fix
Keyboard "sequential mode" and printer
Episode 4
http://www.zippcast.com/video/31acf5aa666f99256a9
Sending ASCII text file from Macintosh 512K to
microcomputer, and printing the file on the AN/FGC-25
Demo
http://www.zippcast.com/video/8a0f40e3806bff93b64
Sending Baudot-coded text file from teletype paper
tape reader to Windows 7 PC running terminal emulator
"Tera Term" (via the MC6800 microcomputer).
11