123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
- <html>
- <head>
- <meta name="GENERATOR" content="Visual Page 1.0 for Windows">
- <meta http-equiv="Content-Type" content="text/html;CHARSET=iso-8859-1">
- <title>TI-73...92+/V200 TI Link Guide</title>
- </head>
- <body bgcolor="#ffffe8">
- <p><b>TI Link Protocol Guide </b>- Hardware Link Protocol </p>
- <center>
- <h2>
- <hr align="center">Hardware Link Protocol<br>
- </h2>
- </center>
- <p>The TI transfer bus (also called DBus) is a two-wire half-duplex
- serial interface consisting of a 'red'/'tip' line (wrapped in red
- insulation)
- and a 'white'/'ring' line (wrapped in white insulation) with a common
- ground.<br>
- Both lines are bi-directional, so outputs must be of an open-drain or
- an open-collector type (such as i²C
- bus for instance). <br>
- Each line is connected to the supply voltage via a pull-up resistor. A
- line is then logic high when both of the
- calculators hold the line high, and logic low if one or more of the
- devices drives the line low.</p>
- <p><img src="graphics/hard_layer.gif"
- alt="[Electrical Schematic of TI-92 Link Circuitry]" align="bottom"
- border="0" height="288" width="311"> <br>
- In this way the calculator or any external device can put the line to
- logical high and monitor the corresponding
- input to see whether the line actually becomes high. This
- open-collector structure allows the calculator to drive
- an I²C device directly.
- </p>
- <h4>The Texas Instruments Hardware Byte-Transfer Protocol</h4>
- <p>The link port normally operates in a half-duplex mode where a bit is
- sent by activating the corresponding line ("ring" or "tip") and the
- receiver acknowledges by activating the other line. The sender now
- releases its line and finally the receiver releases the acknowledge. <br>
- An "error" condition (="abort") is signalled by activating both lines
- at the same time for ~250us. Moreover, the DBus protocol specifies a
- maximum bit time of 2 seconds else link time-out will occur.<br>
- </p>
- <p>Thus, each bit is made of two voltage changes on each two different
- wires. The order of the first two voltage impulses
- determines whether the bit is high (1) or low (0). A logical '0' is
- represented by changing the red wire first,
- wheras a logical '1' is represented by changing the white wire first. A
- sequence of eight bit transfers constitutes
- one byte, least significant bit sent first. The protocol does not allow
- for a distinction of byte boundaries.<br>
- </p>
- <p>The graphing calculator models up to the TI-92 (those with a 6MHz
- Z80 processor) can transfer data at roughly
- 16 to 18 kilobits per second, whereas the TI-89, TI-92 and TI-92+
- (those with the 10-MHz processor) can transfer
- data at roughly 45 to 50 kilobits per second. This is not very fast but
- it was enough for current models like TI89/92+. Later, TI introduced
- handhelds with USB embedded port which should allow better rates.</p>
- <p><u>An example of a byte transfer:</u> The byte represented in the
- figure is 0xC9 (11001001 in binary).<br>
- The first bit transmitted is the least significant bit (LSb) and the
- last one is the most significant bit
- (MSb) as a serial stream.<br>
- Remember that a high status represents a closed circuit and that either
- one of the calculators can pull it low.
- On the other hand, a low status represents a break in the circuit, and
- both calculators must close the circuit
- in order to bring the line high again.<br>
- This figure shows the electrical status of the data lines during a byte
- transfer:</p>
- <p><img src="graphics/protocol.gif" alt="[protocol diagram]"
- align="bottom" border="0" height="74" width="450"></p>
- <p><u>Flow charts of 'put' and 'get' routines:</u> <br>
-
- <table border="1" width="75%">
- <tbody>
- <tr>
- <td>
- <p align="center"><img src="graphics/put_chart.gif"
- alt="[PUT routine flowchart]" align="bottom" border="0" height="526"
- width="315"> </p>
- </td>
- <td>
- <p align="center"><img src="graphics/get_chart.gif"
- alt="[GET routine flowchart]" align="bottom" border="0" height="575"
- width="315"> </p>
- </td>
- </tr>
- </tbody>
- </table>
- </p>
- <h4> Example C Routines for the Parallel Link</h4>
- <p>You will find below 2 examples of routines: one for sending, the
- other for receiving a byte with a parallel
- link cable. Link cables are described in the next section.</p>
- <p><font face="Courier New, Courier, mono">/*</font> <br>
- <font face="Courier New, Courier, mono">Send a byte to the calculator</font>
- <br>
- <font face="Courier New, Courier, mono">*/</font> <br>
- <font face="Courier New, Courier, mono">int put92(char data)</font> <br>
- <font face="Courier New, Courier, mono">{</font> <br>
- <font face="Courier New, Courier, mono"> int bit;</font>
- <br>
- <font face="Courier New, Courier, mono"> for(bit=0;
- bit<8; bit++)</font> <br>
- <font face="Courier New, Courier, mono"> {</font> <br>
- <font face="Courier New, Courier, mono">
- if(data & 1)</font> <br>
- <font face="Courier New, Courier, mono">
- {</font> <br>
- <font face="Courier New, Courier, mono">
- outportb(lpt_out,
- 2);</font> <br>
- <font face="Courier New, Courier, mono">
- while((inportb(lpt_in)
- & 0x10) == 1);</font> <br>
- <font face="Courier New, Courier, mono">
- outportb(lpt_out,
- 3);</font> <br>
- <font face="Courier New, Courier, mono">
- while((inportb(lpt_in)
- & 0x10) == 0);</font> <br>
- <font face="Courier New, Courier, mono">
- }</font> <br>
- <font face="Courier New, Courier, mono">
- else</font> <br>
- <font face="Courier New, Courier, mono">
- {</font> <br>
- <font face="Courier New, Courier, mono">
- outportb(lpt_out,
- 1);</font> <br>
- <font face="Courier New, Courier, mono">
- while((inportb(lpt_in)
- & 0x20) == 1);</font> <br>
- <font face="Courier New, Courier, mono">
- outportb(lpt_out,
- 3);</font> <br>
- <font face="Courier New, Courier, mono">
- while((inportb(lpt_in)
- & 0x20) == 0);</font> <br>
- <font face="Courier New, Courier, mono">
- }</font> <br>
- <font face="Courier New, Courier, mono">
- data >>= 1;</font> <br>
- <font face="Courier New, Courier, mono"> }</font> <br>
- <font face="Courier New, Courier, mono">}</font></p>
- <p><font face="Courier New, Courier, mono">/*</font> <br>
- <font face="Courier New, Courier, mono">Reads a byte from the calculator</font>
- <br>
- <font face="Courier New, Courier, mono">*/</font> <br>
- <font face="Courier New, Courier, mono">unsigned char get92(void)</font>
- <br>
- <font face="Courier New, Courier, mono">{</font> <br>
- <font face="Courier New, Courier, mono"> int bit;</font>
- <br>
- <font face="Courier New, Courier, mono"> unsigned
- char v, data=0;</font></p>
- <p><font face="Courier New, Courier, mono">
- for(bit=0; bit<8; bit++)</font> <br>
- <font face="Courier New, Courier, mono"> {</font> <br>
- <font face="Courier New, Courier, mono">
- while((v = inportb(lpt_in) &
- 0x30) == 0x30);</font> <br>
- <font face="Courier New, Courier, mono">
- if(v & 1)</font> <br>
- <font face="Courier New, Courier, mono">
- {</font> <br>
- <font face="Courier New, Courier, mono">
- data
- = (data >> 1) | 0x80;</font> <br>
- <font face="Courier New, Courier, mono">
- outportb(lpt_out,
- 1);</font> <br>
- <font face="Courier New, Courier, mono">
- while((inportb(lpt_in)
- & 0x20) == 0x00);</font> <br>
- <font face="Courier New, Courier, mono">
- outportb(lpt_out,
- 3);</font> <br>
- <font face="Courier New, Courier, mono">
- }</font> <br>
- <font face="Courier New, Courier, mono">
- else</font> <br>
- <font face="Courier New, Courier, mono">
- {</font> <br>
- <font face="Courier New, Courier, mono">
- data
- = data >> 1;</font> <br>
- <font face="Courier New, Courier, mono">
- outportb(lpt_out,
- 2);</font> <br>
- <font face="Courier New, Courier, mono">
- while((inportb(lpt_in)
- & 0x10) == 0x00);</font> <br>
- <font face="Courier New, Courier, mono">
- outportb(lpt_out,
- 3);</font> <br>
- <font face="Courier New, Courier, mono">
- }</font> <br>
- <font face="Courier New, Courier, mono"> }<br>
- }</font></p>
- <p>If you want use a link cable for your own project, you should know
- that a complete and multi-platform library exists for handling the
- different link cables (hardware & virtual) thru a common API. The
- libticables library (source and .dll/.so) can be found either on <a
- href="http://www.ticalc.org">ticalc.org</a> (unix directory of the
- ticalc's archives) or on the <a href="http://lpg.ticalc.org/prj_tilp/">TiLP
- (formerly GtkTiLink) homepage</a>. </p>
- <h4>More Information</h4>
- <p>You will find here, as a separate documentation, various documents
- on the parallel and serial port structure:
- </p>
- <ul>
- <li><a
- href="http://gladstone.uoregon.edu/%7Etsinger/TI-86/misc/RS232.html">RS232</a>
- information </li>
- <li><a
- href="http://gladstone.uoregon.edu/%7Etsinger/TI-86/misc/LPTx.htm">parallel</a>
- port registers on the PC </li>
- <li><a
- href="http://gladstone.uoregon.edu/%7Etsinger/TI-86/misc/COMx.htm">serial</a>
- port registers on the PC
- </li>
- </ul>
- <p>
- <table border="0" cellspacing="0" width="100%">
- <tbody>
- <tr>
- <td width="32%">
- <p align="center"><a href="intro.html"><img
- src="graphics/prevpage.gif" alt="[previous page]" align="bottom"
- border="2" height="32" width="32"><br>
- Introduction</a> </p>
- </td>
- <td width="34%">
- <p align="center"><a href="index.html"><img
- src="graphics/home.gif" alt="[home]" align="bottom" border="2"
- height="32" width="32"><br>
- Table of Contents</a> </p>
- </td>
- <td width="34%">
- <p align="center"><a href="cable.html"><img
- src="graphics/nextpage.gif" alt="[next page]" align="bottom" border="2"
- height="32" width="32"><br>
- Link Cables</a> </p>
- </td>
- </tr>
- </tbody>
- </table>
- </p>
- <hr align="center"><i>Site maintained by Romain Liévin (</i><a
- href="mailto:roms@tilp.info"><i>roms@tilp.info</i></a><i>)
- and Tim Singer (</i><a href="mailto:tsinger@gladstone.uoregon.edu"><i>tsinger@gladstone.uoregon.edu</i></a><i>)</i>
- </body>
- </html>
|