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:

.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)

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 :\
Well, what you're doing is more or less correct, from the code you have there. I would try turning interrupts off when you start and back on when you exit, but I'm not sure if that will do the trick. Just to double-check, you're connecting to pins 4 and 7, and connecting ground to ground, right?
Yep, I'm connecting the tip/red to digital pin 4, white/ring to digital 7 and ground to ground.

I already tried disabling the interrupts with di on start and ei on exit, something like:

Code:
main:
di
(...)

exit:
ei
ret

but nothing seemed to behave differently

I also did that in combination with disabling the link assist (after disabling the interrupts), and nothing happened.
That's quite fristrating; in my MobileTunes 3 music-playing program, which creates tones by quickly toggling link port lines, I just do a simple di before I start manipulating the lines, and nothing bad happens. Sad May I ask if anything changes if you run your program with Doors CS installed, either from Doors CS or via HomeRun, instead of using the TI-OS?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement