$4 link
[Prev][Next][Index][Thread]
$4 link
This is a multi-part message in MIME format.
--------------5C835E24C89
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Well the first time I tried the $4 link, my calculator kept freezing.
I kept trying and trying. I finally checked my connections and found an
error. The 330 resistor wasn't connected to the LED. I fixed the error.
I then tried to send and recieve something but my calculator still
froze.
After doing all this my $4 link was still not working, but there were
signs that some data was being sent. I got errors like "Waiting...Hdrlen
too big:-27." Timo Stenberg, maker of the $4 link, said my red and white
wire connecting to the 2.5mm plug could be in the wrong place and said
to switch them. I checked them, according to the schematic it was in the
right place, but I switched them anyway. Then I started measuring the
voltages from tip and middle to ground on the 2.5mm plug.
I found out that when you get into Thriftylink, it doesn't properly
intilize the port sometimes. You have to hit the xmit button and then
the two shift keys, then hit recieve and then the two shift keys. This
should intilize the port now. The voltages from tip and middle to ground
should be about +4.7volts. The calculator doesn't freeze anymore. After
all this, it started working. I suggest that you first try to
succesfully get a screen dump.
It seems the 2.5mm cable's(from Mouser Electronics) red and white wires
are the opposite
of TI's calc-calc link.
I have included a test software that will test the $4 link, you'll need
BASIC to run it.
If anybody needs any of this clarified or help, email me.
--------------5C835E24C89
Content-Type: text/plain; charset=us-ascii; name="4$link.bas"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="4$link.bas"
REM TI-LINK (4$ serial) tester by Timo Stenberg
REM Can be used with a DVM to test the operation of the hardware.
REM System test can be performed by starting screen dump (from calc to PC),
REM the result is shown on PC's screen.
REM This stuff is freeware.
REM NO QUARANTEES FOR HARDWARE OR SOFTWARE IS GIVEN.
REM WRONG CONNECTIONS MAY DAMAGE THE CALCULATOR, BE CAREFUL!
DEFINT A-Z
DECLARE FUNCTION getbit ()
DECLARE SUB sendbyt (b)
DECLARE FUNCTION getbyt ()
DECLARE FUNCTION getdata ()
DECLARE SUB getscreen ()
DECLARE SUB iotest ()
DECLARE SUB ps (s$)
ioport = &H3F8
Port = 1
ctype = 5
redraw:
CLS
LOCATE 10, 1
PRINT "Name 9-pin 25-pin"
ps (" DSR 6 6 o________\ TI8x cable")
ps (" |")
ps (" DTR 4 20 o_[3.3k]_^__________!______o white, middle")
ps (" |")
ps (" GND 5 7 o__[>I___\ /_[>I_{")
ps (" LED | | 4.7V zener")
ps (" | |")
ps (" TXD 3 2 o_[330R]_^__!_^____________o screen, base")
ps (" | 4.7V zener")
ps (" CTS 8 5 o________\ }___[>I_\")
ps (" | |")
ps (" RTS 7 4 o_[3.3k]_^__________^______o red, tip")
PRINT
PRINT "TI-LINK (4$ serial) by Timo Stenberg"
again:
LOCATE 1, 1
PRINT "PORT ="; Port; " CALC = TI"; -80 - ctype
PRINT
PRINT "Press s to start screen transfer from calc"
PRINT "Press t to start link hardware testing"
PRINT "Press p to toggle COM port"
PRINT "Press c to toggle calculator type"
PRINT "Press e to stop"
a$ = INKEY$
IF a$ = "s" THEN CALL getscreen: GOTO redraw
IF a$ = "t" THEN CALL iotest: GOTO redraw
IF a$ = "p" THEN
Port = 3 - Port
IF Port = 1 THEN ioport = &H3F8 ELSE ioport = &H2F8
END IF
IF a$ = "c" THEN ctype = 7 - ctype
IF a$ = "e" THEN END
GOTO again
FUNCTION getbit
SHARED ioport
b = INP(ioport + 6) / 16 AND 3
REM b$ = CHR$(b + 48) :REM use these for debugginig
REM PRINT b$;
getbit = b
END FUNCTION
FUNCTION getbyt
SHARED ioport
curbit = 1
byt = 0
FOR bits = 1 TO 8
DO: x = getbit: LOOP WHILE x = 3
IF x = 1 THEN
byt = byt + curbit
OUT ioport + 4, 1
x = 2
ELSE
OUT ioport + 4, 2
x = 1
END IF
DO WHILE (getbit AND x) = 0: LOOP
OUT ioport + 4, 3
curbit = curbit * 2
NEXT
getbyt = byt
END FUNCTION
SUB getscreen
SHARED ctype
SCREEN 1
LOCATE 15, 1
PRINT "Connect the calculator, switch power on"
PRINT "Getting screen dump"
PRINT "Print CTRL-BREAK to quit"
sendbyt (ctype): sendbyt (&H6D): sendbyt (0): sendbyt (0)
PRINT "6DH sent"
d = getbyt: ack = getbyt: d = getbyt: d = getbyt
PRINT "Ack was "; ack
h1 = getbyt
h2 = getbyt
h3 = getbyt
h4 = getbyt
IF h4 > 10 THEN
PRINT "error, len > "; h4 * 10
EXIT SUB
END IF
l = h4 * 256 + h3
IF l = 1024 THEN
w = 15
ELSEIF l = 768 THEN
w = 11
ELSE
PRINT "error, len is"; ln
EXIT SUB
END IF
FOR y = 0 TO 63
x = 0
FOR c = 0 TO w
pixl = getbyt
FOR i = 1 TO 8
IF pixl > 127 THEN PSET (x, y): pixl = pixl - 128
pixl = pixl + pixl
x = x + 1
NEXT
NEXT
NEXT
cl = getbyt
ch = getbyt
PRINT "Press any key"
DO: k$ = INKEY$: LOOP WHILE k$ = ""
SCREEN 0: WIDTH 80
END SUB
SUB iotest
SHARED ioport
CLS
bs = 0
OUT ioport + 4, 3
PRINT "Disconnect calculator, connect link hardware to PC"
PRINT "Press any key when ready (q=quit)"
DO: k$ = INKEY$: IF k$ = "q" THEN EXIT SUB
LOOP WHILE k$ = ""
b = getbit
PRINT
IF b <> 3 THEN
BEEP
PRINT "input ="; b;
PRINT " WRONG PORT OR SOME OTHER PROBLEM"
bs = 100
ELSE
PRINT "Measure voltage from TIP and MIDL to BASE of TI cable"
PRINT "The voltage should be a bit less than +5V (depends on zeners)"
END IF
PRINT "Press any key or q"
DO: k$ = INKEY$: IF k$ = "q" THEN EXIT SUB
LOOP WHILE k$ = ""
OUT ioport + 4, 0
b = getbit
PRINT
IF b <> 0 THEN
BEEP
PRINT "input ="; b;
PRINT " WRONG PORT OR SOME OTHER PROBLEM"
bs = 200
ELSE
PRINT "Measure voltage from TIP and MIDL to BASE of TI cable"
PRINT "The voltage should be -0.7V"
END IF
PRINT "Press any key or q"
DO: k$ = INKEY$: IF k$ = "q" THEN EXIT SUB
LOOP WHILE k$ = ""
OUT ioport + 4, 2
b = getbit
PRINT
IF b <> 1 THEN
BEEP
PRINT "input ="; b;
PRINT " WRONG PORT OR SOME OTHER PROBLEM"
IF b = 2 THEN
PRINT "Seems that your wires are crossed (DTR<->RTS or DSR<->CTS)"
END IF
bs = 300
ELSE
PRINT "Now TIP should be at about 4.7V and MIDL at -0.7V"
END IF
PRINT "Press any key or q"
DO: k$ = INKEY$: IF k$ = "q" THEN EXIT SUB
LOOP WHILE k$ = ""
OUT ioport + 4, 3
PRINT
PRINT "Shortcircuit TIP or MIDL to BASE, each time the selected"
PRINT "pin will be displayed. Press any key when done"
bb = 5
bs = 0
DO
b = getbit
IF b <> bb THEN
IF (b AND 1) = 0 THEN PRINT "TIP "; : bs = bs OR 1
IF (b AND 2) = 0 THEN PRINT "MIDL "; : bs = bs OR 2
END IF
bb = b
k$ = INKEY$
LOOP WHILE k$ = ""
OUT ioport + 4, 3
PRINT
PRINT
IF bs = 3 THEN
PRINT "If the measured voltages were OK, then your link probably works."
ELSE
BEEP
PRINT "There were some problems. Fix them before continuing."
END IF
PRINT "Press any key"
DO: k$ = INKEY$: LOOP WHILE k$ = ""
END SUB
SUB ps (s$)
ascii$ = "/{_\}^!|"
g$ = CHR$(218) + CHR$(217) + CHR$(196) + CHR$(191)
g$ = g$ + CHR$(192) + CHR$(193) + CHR$(194) + CHR$(179)
FOR i = 1 TO LEN(s$)
b = INSTR(ascii$, MID$(s$, i, 1))
IF b = 0 THEN PRINT (MID$(s$, i, 1)); ELSE PRINT MID$(g$, b, 1);
NEXT
PRINT
END SUB
SUB sendbyt (b)
SHARED ioport
FOR bits = 1 TO 8
IF b AND 1 THEN OUT ioport + 4, 2: ELSE OUT ioport + 4, 1
DO WHILE getbit <> 0: LOOP
OUT ioport + 4, 3
DO WHILE getbit <> 3: LOOP
b = b \ 2
NEXT
END SUB
--------------5C835E24C89--