So I finally decided to start a topic Smile

TI-nterface it basically an arduino in a box which has to communicate with a calculator. Once that's accomplished everything will be much easier.

I got some code Kerm made, but I'm not sure if this works with AXE code or BASIC. I know NO ASM at all.

(Axe is faster, but basic is easier to understand for the other students)
Well, there's the handy-dandy Get() and Send() calls in BASIC, so I don't see any particularly good reason not to offer BASIC programmers an interface to use it! Also, I don't think the speed of Axe would necessarily be too important here, do you? Why would you need speed?

Tell me about your existing code and hardware. My experience with my Arduino - TI Link Protocol project and globalCALCnet (as well as my EE degrees and two decades of fun experience! </tooting-own-horn>) tell me that there's no extra hardware needed, just two digital I/O pins and ground.

Edit: I have a lot of problems with this code that you shared with us. Starting from nowhere in particular, besides the baffling combination of analog and digital pins, you never update the time variable around line 55, so your timeout there won't work. You also don't set the output pins as high to start, which is problematic.
KermMartian wrote:
Well, there's the handy-dandy Get() and Send() calls in BASIC, so I don't see any particularly good reason not to offer BASIC programmers an interface to use it! Also, I don't think the speed of Axe would necessarily be too important here, do you? Why would you need speed?

Tell me about your existing code and hardware. My experience with my Arduino - TI Link Protocol project and globalCALCnet (as well as my EE degrees and two decades of fun experience! </tooting-own-horn>) tell me that there's no extra hardware needed, just two digital I/O pins and ground.

Edit: I have a lot of problems with this code that you shared with us. Starting from nowhere in particular, besides the baffling combination of analog and digital pins, you never update the time variable around line 55, so your timeout there won't work. You also don't set the output pins as high to start, which is problematic.

Comeon Smile It's my first arduino project. I program the thing 2 days now Razz

I changed the code (updating time correctly)

Code:
void setup(){
 pinMode(2,OUTPUT);
 pinMode(3,OUTPUT);
 Serial.begin(9600);
}
/////////////////////////////////////////////////////////////////////////////
///~~~~[ IO SEND function ]~~~~///////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////



/////////////////////////////////////////////////////////////////////////////
///~~~~[ IO GET function ]~~~~///////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
int IOget(int timeout){
 int time=0;
 int number=0;
 
 for(int i=0;i<8;i++){
////////////////////////////////////////////////
  while(time!=timeout && analogRead(A4)>200 && analogRead(A5)>200){
    time++;                //escape when time runs out or one of the lines gets pulled down
  }
  if (time==timeout){      //if time ran out return -1 (error)
   return -1;
  }
////////////////////////////////////////////////
  time=0;                  //reset timer
  if(analogRead(A4)>200){  //if red is high
   Serial.print("1");
   
   bitSet(number,i);   //the bit is one[1]
   digitalWrite(3,HIGH);   //R=0
   while(time!=timeout){
    if (analogRead(A5<200)){
    break;
    }
    time++;
   }
   if (time==timeout){     //if time ran out
   digitalWrite(3,LOW);
   return -1;
  }
////////////////////////////////////////////////
  digitalWrite(3,LOW);     //R=1
  time=0;               //reset timer
  }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
  else
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
  {
  //the bit is zero[0] so no bit is set
  Serial.print("0");
   digitalWrite(2,HIGH);   //R=0
   
   while(time!=timeout){
    if (analogRead(A4<200)){
    break;
    }
    time++;
   }
   if (time==timeout){     //if time ran out return -1 (error) and R=1
   digitalWrite(2,LOW);
   return -1;
   
  }
////////////////////////////////////////////////
  digitalWrite(2,LOW);     //R=1
  time=0;                  //reset timer 
  }
 }
 return number;
 
 
}

void loop(){
 Serial.println(IOget(2000));
 delay(100);
}



When I set the state of the linkport (calc side) to either red1 white0 or white1 red0 it gives me all ones or all zero's, so there is something wrong with the confirmation signal processing.
[/code]
Let's step back a second. What protocol are you trying to talk? TI Link Protocol, CALCnet, something custom? Is it at least something that follows the TI Link Protocol's scheme of timing?
KermMartian wrote:
Let's step back a second. What protocol are you trying to talk? TI Link Protocol, CALCnet, something custom? Is it at least something that follows the TI Link Protocol's scheme of timing?

I first tried my own link protocol which didn't work, so I tried to emulate the AXE link protocol. I assumed that it would follow the same rules as the OS protocol, but it doesn't seem to work. I wonder if there are any "obvious bugs" in this code. If not then I will use your code and this site: http://myserverathome.com/linkguide/ti83+/indexex2.html (it's actually a mirror of a site)
That's Merthsoft's site (one of my administrators); the original is this file at ticalc.org. Yes, I've used it before, for many different things including SourceCoder and jsTIfied's silent-linking capabilities. Although ironically, I used manual reverse-engineering for that Arduino-TI code. I think one of your fundamental misunderstanding (if I'm reading your comments correctly in a very quick perusal) is that lines go low, not high, to indicate them being "set".
KermMartian wrote:
That's Merthsoft's site (one of my administrators); the original is this file at ticalc.org. Yes, I've used it before, for many different things including SourceCoder and jsTIfied's silent-linking capabilities. Although ironically, I used manual reverse-engineering for that Arduino-TI code. I think one of your fundamental misunderstanding (if I'm reading your comments correctly in a very quick perusal) is that lines go low, not high, to indicate them being "set".

I have spent half a year researching. I know how this works by now Smile
Ah, I thought that that was not the case, vis a vis "It's my first arduino project. I program the thing 2 days now". Very Happy No insults intended. Nevertheless, from your code you're waiting for things to go high, unless you've for some reason built yourself an inversion circuit.
KermMartian wrote:
Ah, I thought that that was not the case, vis a vis "It's my first arduino project. I program the thing 2 days now". Very Happy No insults intended. Nevertheless, from your code you're waiting for things to go high, unless you've for some reason built yourself an inversion circuit.

Because I didn't know anything about the arduino's hardware in the first place. Programming is not the hardest part; it's getting to know what I have to accomplish with certain code. I'm now studying on "the linkguide" to know how certain data packets are sent.
Would you mind sharing the schematics and/or photographs of whatever hardware you're using to interface, so I can understand if you're doing level shifting or inversion of some kind? And excellent, that's a good reference to learn such things.
I am not using the additional hardware anymore. It simply doesn't fit in the box and it's not necessary, is it? My primary concern is the presentation this wednesday. I will use some good old fakery to make it appear everything works as planned, but actually I will just use the white and red line as I/O pins. When white gets pulled down my calc will run a "combination lock" program. When the correct number is entered the red line goes low and the arduino will turn on an LED.

These are pictures of the device. There is nothing inside except for some wires, an arduino and a 2,5 mm connector.

You did a pretty good job on that! I assume those are banana jacks connected to digital and/or analog I/O lines? Also, I really want to help you to get your communication routines working sooner or later, though, so let's keep discussing them.
Those are no banana jack connectors unfortunately. Those are so called "solderless connectors" which means: springs. I had to come up with something quickly because the banana jack connectors have not arrived yet. I only wired up 5 pins out of 8 for the presentation which are 2 outputs, one input, Vcc and ground. I might add a reset button, because my code uses infinite loops without timeout code.
Ahhh, gotcha. Those look a lot like the springs from my much-loved RadioShack kits from when I was six years old (and thenceforth), actually, except upside-down.
KermMartian wrote:
Ahhh, gotcha. Those look a lot like the springs from my much-loved RadioShack kits from when I was six years old (and thenceforth), actually, except upside-down.

Yep Razz I put em upside down to make them more stable. These are the only "connectors" I have at the moment. My presentation is tonight and I'm quite nervous.
Good luck, Keoni29, I hope it goes well! Now get off the internet and go to sleep so that you're well-rested for the presentation. Wink
KermMartian wrote:
Good luck, Keoni29, I hope it goes well! Now get off the internet and go to sleep so that you're well-rested for the presentation. Wink

I live in another time zone Smile
Fair enough, that's no great surprise around here. Very Happy Be sure to let us know how the presentation went, and I presume we'll resume debugging the byte-sending protocol soon?
KermMartian wrote:
Fair enough, that's no great surprise around here. Very Happy Be sure to let us know how the presentation went, and I presume we'll resume debugging the byte-sending protocol soon?

The presentation went smoothly. My teacher as well as the technical assistent were quite impressed by my work. I can borrow his calculator until I get my diploma Smile

I found out how the Axe linkprotocol works thanks to some omnimaga members. This is how it works (thanks to runer112)
http://ourl.ca/14710/285899
(code doesn't seem to use teletype here, so here is a link to his post)

This weekend I will probably have a functional link protocol.
If you put the code in [code] boxes, it uses a monospaced font. Smile The forum doesn't automatically detect things that are code, though (not that I think any forum does). Why not stick with the TI link protocol, though, so you could use CCBL/CBR devices?
  
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 1 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