Thanks for your time, _player and KermMartian.
However, neither removing the link cable, leaving the lines high when exiting or turning the pullup resistors on as in KermMartian's code works.
I made a larger program to change the lines on the fly from the calculator:
Code:
and testing it with the arduino sketch I posted:
if I press 0 on the calculator, the output on the arduino's serial monitor is "red is 1 and white is 0" infinitely. if I press Clear in this situation, the calculator will return to the main prompt normally, without freezing
if I press 1, 2 or 3 the output on the serial is something like
and if I press Clear, it will return to the prompt, the cursor will show but without blinking, and the calculator becomes slow.
With the pullup resistors on, whatever key I press, the arduino output is always "red is 1 and white is 1". Exiting after pressing 0 doesn't hang the calc, but after pressing 1,2 or 3 does, just like above.
Is the random output the result of the calculator trying to proceed with the protocol? If so, then why does setting the link port to $D3 or 3 (setting both wires low, right?) also output random values?
Wasn't the command "out (0), a" supposed to hold the wire in the state I set it to? Probably something here doesn't work as I think it does :\
However, neither removing the link cable, leaving the lines high when exiting or turning the pullup resistors on as in KermMartian's code works.
I made a larger program to change the lines on the fly from the calculator:
Code:
.nolist
#include "ti83plus.inc"
#define ProgStart $9D95
.list
.org ProgStart - 2
.db t2ByteTok, tAsmCmp
main:
; ld a, %10000000
; out (8), a
b_call(_GetCSC)
cp skClear
jp z, exit
cp sk0
jp z, pressed0
cp sk1
jp z, pressed1
cp sk2
jp z, pressed2
cp sk3
jp z, pressed3
jp main
pressed0:
ld a, $D0
out (0), a
ld hl, strpress0
b_call(_PutS)
b_call(_NewLine)
jp main
pressed1:
ld a, $D1
out (0), a
ld hl, strpress1
b_call(_PutS)
b_call(_NewLine)
jp main
pressed2:
ld a, $D2
out (0), a
ld hl, strpress2
b_call(_PutS)
b_call(_NewLine)
jp main
pressed3:
ld a, $D3
out (0), a
ld hl, strpress3
b_call(_PutS)
b_call(_NewLine)
jp main
exit:
ret
strpress0:
.db "red 1 white 1",0
strpress1:
.db "red 0 white 1",0
strpress2:
.db "red 1 white 0",0
strpress3:
.db "red 0 white 0",0
.end
.end
and testing it with the arduino sketch I posted:
if I press 0 on the calculator, the output on the arduino's serial monitor is "red is 1 and white is 0" infinitely. if I press Clear in this situation, the calculator will return to the main prompt normally, without freezing
if I press 1, 2 or 3 the output on the serial is something like
Quote:
red is 1 and white is 1
red is 0 and white is 0
red is 1 and white is 0
red is 0 and white is 1
red is 0 and white is 0
red is 1 and white is 0
red is 1 and white is 1
red is 0 and white is 0
red is 0 and white is 0
red is 1 and white is 1
red is 0 and white is 1
red is 0 and white is 0
red is 1 and white is 0
(a lot of apparently random 1s and 0s follow)
red is 0 and white is 0
red is 1 and white is 0
red is 0 and white is 1
red is 0 and white is 0
red is 1 and white is 0
red is 1 and white is 1
red is 0 and white is 0
red is 0 and white is 0
red is 1 and white is 1
red is 0 and white is 1
red is 0 and white is 0
red is 1 and white is 0
(a lot of apparently random 1s and 0s follow)
and if I press Clear, it will return to the prompt, the cursor will show but without blinking, and the calculator becomes slow.
With the pullup resistors on, whatever key I press, the arduino output is always "red is 1 and white is 1". Exiting after pressing 0 doesn't hang the calc, but after pressing 1,2 or 3 does, just like above.
Is the random output the result of the calculator trying to proceed with the protocol? If so, then why does setting the link port to $D3 or 3 (setting both wires low, right?) also output random values?
Wasn't the command "out (0), a" supposed to hold the wire in the state I set it to? Probably something here doesn't work as I think it does :\