CEMETECH
Leading The Way To The Future
Login [Register]
Username:
Password:
Autologin:

Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 138 users online: 4 members, 114 guests and 20 bots.
Members: APotato.
Bots: MSN/Bing (2), VoilaBot (5), Spinn3r (2), Magpie Crawler (3), VoilaBot (1), Googlebot (7).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
Author Message
keoni29


New Member


Joined: 18 Feb 2012
Posts: 81

Posted: 19 Feb 2012 01:55:25 pm    Post subject: Arduino link to TI84+ (TI-nterface)

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)
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 59236

Posted: 19 Feb 2012 02:23:57 pm    Post subject:

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


Back to top
keoni29


New Member


Joined: 18 Feb 2012
Posts: 81

Posted: 19 Feb 2012 02:51:09 pm    Post subject:

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]
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 59236

Posted: 19 Feb 2012 02:58:52 pm    Post subject:

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?
_________________


Back to top
keoni29


New Member


Joined: 18 Feb 2012
Posts: 81

Posted: 19 Feb 2012 03:03:37 pm    Post subject:

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)
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 59236

Posted: 19 Feb 2012 03:07:07 pm    Post subject:

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".
_________________


Back to top
keoni29


New Member


Joined: 18 Feb 2012
Posts: 81

Posted: 19 Feb 2012 03:12:25 pm    Post subject:

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
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 59236

Posted: 19 Feb 2012 08:23:29 pm    Post subject:

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


Back to top
keoni29


New Member


Joined: 18 Feb 2012
Posts: 81

Posted: 20 Feb 2012 03:27:25 am    Post subject:

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.
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 59236

Posted: 20 Feb 2012 09:11:17 am    Post subject:

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


Back to top
keoni29


New Member


Joined: 18 Feb 2012
Posts: 81

Posted: 20 Feb 2012 01:03:29 pm    Post subject:

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.

Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 59236

Posted: 20 Feb 2012 01:05:47 pm    Post subject:

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


Back to top
keoni29


New Member


Joined: 18 Feb 2012
Posts: 81

Posted: 21 Feb 2012 05:58:58 am    Post subject:

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.
_________________
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 59236

Posted: 21 Feb 2012 02:21:59 pm    Post subject:

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


Back to top
keoni29


New Member


Joined: 18 Feb 2012
Posts: 81

Posted: 22 Feb 2012 02:20:22 am    Post subject:

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.
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 59236

Posted: 22 Feb 2012 02:22:12 am    Post subject:

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
_________________


Back to top
keoni29


New Member


Joined: 18 Feb 2012
Posts: 81

Posted: 22 Feb 2012 07:04:23 am    Post subject:

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
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 59236

Posted: 22 Feb 2012 10:47:41 am    Post subject:

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?
_________________


Back to top
keoni29


New Member


Joined: 18 Feb 2012
Posts: 81

Posted: 22 Feb 2012 02:00:29 pm    Post subject:

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.
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 59236

Posted: 22 Feb 2012 02:03:15 pm    Post subject:

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?
_________________


Back to top
Display posts from previous:   
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
    Goto page 1, 2  Next
View previous topic :: View next topic  
Page 1 of 2 All times are GMT - 5 Hours

 
Jump to:  
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

© Copyright 2000-2014 Cemetech & Kerm Martian :: Page Execution Time: 0.044403 seconds.