Difference between revisions of "83Plus:Ports:00"
m (Added categories) |
|||
(27 intermediate revisions by 11 users not shown) | |||
Line 1: | Line 1: | ||
− | [[Category:83Plus:Ports:By_Address|00 - Link]] | + | [[Category:83Plus:Ports:By_Address|00 - Link]] [[Category:83Plus:Ports:By_Name|Link]] |
− | [[Category:83Plus:Ports:By_Name|Link]] | + | |
== Synopsis == | == Synopsis == | ||
'''Port Number:''' 00h | '''Port Number:''' 00h | ||
+ | |||
+ | '''Function:''' Link | ||
This port controls the calculator's serial link port (the standard link port present on the 83+, 83+ SE, 84+ and 84+ SE - do not confuse this with the 84+/84+SE's USB link port). | This port controls the calculator's serial link port (the standard link port present on the 83+, 83+ SE, 84+ and 84+ SE - do not confuse this with the 84+/84+SE's USB link port). | ||
=== Read Values === | === Read Values === | ||
− | * | + | * Bits 0 and 1: These bits indicate the state of the link port's two lines. If a bit is set that indicates the line is high, and if it is reset that indicates the line is low. When idle (no transfer in progress, no cable plugged in, etc), both lines are usually high. When a cable is connected on both ends, a line reads high if and only if both ends have set the line high. The line will read low if either calculator sets it low. Bit 0 is the tip and bit 1 is the ring. |
− | * Bit 5 and | + | *'''83+ only:''' Bit 2: Set means link receive assist is active. |
− | * Bit | + | *'''83+ only:''' Bit 3: Set when link assist has received a complete byte. The only way to reset this bit is to read [[83Plus:Ports:05|port 5]]. |
+ | * Bit 4 and 5: Bits 4 and 5 indicate which lines are pulled low by the calculator (unlike bits 0 and 1 they are not influenced by the other calculator). A 1 bit indicates your calculator is holding the line low. A 0 bit indicates your calculator is not holding the line low. (When both calculators have a 0 bit here, the corresponding line will read 1.) In other words, these bits reflect bits 0 and 1 from the most recent write to this port. | ||
+ | * '''83+ only:''' Bit 6: Set if the link assist is currently receiving data. | ||
=== Write Values === | === Write Values === | ||
− | * | + | * Bits 0 and 1: Setting a bit will pull the line low. Resetting a bit will stop holding the line low (allowing it to go high if the other calculator is not holding it low). Remember a low line will read as a bit being reset, but when writing setting a bit brings the line low. |
− | * Bit 2: | + | *'''83+ only:''' Bit 2: Set this bit to enable the link receive assist. After setting this bit, poll port 0 until bit 3 is high, at which point read from [[83Plus:Ports:05|port 5]] to get the byte. |
<br> | <br> | ||
== Comments == | == Comments == | ||
− | === | + | === TI-OS Interference === |
− | + | One thing to keep in mind when writing link port related software is that the Ti-OS checks for silent transfers in the background of input routines. When two calculators are connected and one pulls a line low, the other calculator will respond by pulling the other line low to acknowledge that it has received a bit. Even when the other calculator is running an assembly program that uses the getkey romcall. This phenomenon is known to cause severe headaches for programmers who attempt to write synchronization routines :). | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | === | + | === Data Transfer === |
− | + | Transferring an entire byte requires you to implement some form of protocol. Examples include TI's official linking protocol, [http://www.ticalc.org/archives/files/fileinfo/277/27718.html Michael Vincent's TachyonLink protocol] and [http://bell.timendus.com/ Timendus' Bell library]. | |
− | + | Other useful information on linking in general: | |
− | + | * [http://www.ticalc.org/archives/files/fileinfo/247/24750.html TI Link Protocol & File Format Guide] | |
− | + | * [http://www.ticalc.org/archives/files/fileinfo/294/29418.html Ti-83 Link Port Tutorial] (note that this deals with the TI-83, not the 83 Plus, where the the hardware is [[83:Ports:00|somewhat different]].) | |
− | + | * [http://www.ticalc.org/archives/files/fileinfo/242/24244.html All about the Ti-86 link port] | |
− | * [http://www.ticalc.org/archives/files/fileinfo/247/24750.html TI Link Protocol & File Format Guide] | + | * [http://bell.timendus.com/ Bell] and [http://clap.timendus.com/ CLAP] projects |
− | * [http://www.ticalc.org/archives/files/fileinfo/294/29418.html Ti-83 Link Port Tutorial] | + | |
− | + | ||
== Example == | == Example == | ||
=== Sending/Setting === | === Sending/Setting === | ||
− | < | + | <nowiki> ld a,0 ; Set both lines high |
− | out (0),a | + | out (0),a |
− | ld a,2 ; Set tip high, ring low | + | ld a,2 ; Set tip high, ring low |
− | out (0),a | + | out (0),a |
− | ld a,1 ; Set tip low, ring high | + | ld a,1 ; Set tip low, ring high |
− | out (0),a | + | out (0),a |
− | ld a,3 ; Set both low | + | ld a,3 ; Set both low |
− | out (0),a</ | + | out (0),a</nowiki> |
=== Receiving/Reading === | === Receiving/Reading === | ||
− | < | + | <nowiki> in a,(0) ; Get link port value |
− | bit 0,a ; Check tip | + | bit 0,a ; Check tip |
− | jr z,tip_low | + | jr z,tip_low |
− | jr nz,tip_high | + | jr nz,tip_high |
− | bit 1,a ; Check ring | + | bit 1,a ; Check ring |
− | jr z,ring_low | + | jr z,ring_low |
− | jr nz,ring_high</ | + | jr nz,ring_high</nowiki> |
Latest revision as of 07:14, 17 March 2020
Contents
Synopsis
Port Number: 00h
Function: Link
This port controls the calculator's serial link port (the standard link port present on the 83+, 83+ SE, 84+ and 84+ SE - do not confuse this with the 84+/84+SE's USB link port).
Read Values
- Bits 0 and 1: These bits indicate the state of the link port's two lines. If a bit is set that indicates the line is high, and if it is reset that indicates the line is low. When idle (no transfer in progress, no cable plugged in, etc), both lines are usually high. When a cable is connected on both ends, a line reads high if and only if both ends have set the line high. The line will read low if either calculator sets it low. Bit 0 is the tip and bit 1 is the ring.
- 83+ only: Bit 2: Set means link receive assist is active.
- 83+ only: Bit 3: Set when link assist has received a complete byte. The only way to reset this bit is to read port 5.
- Bit 4 and 5: Bits 4 and 5 indicate which lines are pulled low by the calculator (unlike bits 0 and 1 they are not influenced by the other calculator). A 1 bit indicates your calculator is holding the line low. A 0 bit indicates your calculator is not holding the line low. (When both calculators have a 0 bit here, the corresponding line will read 1.) In other words, these bits reflect bits 0 and 1 from the most recent write to this port.
- 83+ only: Bit 6: Set if the link assist is currently receiving data.
Write Values
- Bits 0 and 1: Setting a bit will pull the line low. Resetting a bit will stop holding the line low (allowing it to go high if the other calculator is not holding it low). Remember a low line will read as a bit being reset, but when writing setting a bit brings the line low.
- 83+ only: Bit 2: Set this bit to enable the link receive assist. After setting this bit, poll port 0 until bit 3 is high, at which point read from port 5 to get the byte.
Comments
TI-OS Interference
One thing to keep in mind when writing link port related software is that the Ti-OS checks for silent transfers in the background of input routines. When two calculators are connected and one pulls a line low, the other calculator will respond by pulling the other line low to acknowledge that it has received a bit. Even when the other calculator is running an assembly program that uses the getkey romcall. This phenomenon is known to cause severe headaches for programmers who attempt to write synchronization routines :).
Data Transfer
Transferring an entire byte requires you to implement some form of protocol. Examples include TI's official linking protocol, Michael Vincent's TachyonLink protocol and Timendus' Bell library.
Other useful information on linking in general:
- TI Link Protocol & File Format Guide
- Ti-83 Link Port Tutorial (note that this deals with the TI-83, not the 83 Plus, where the the hardware is somewhat different.)
- All about the Ti-86 link port
- Bell and CLAP projects
Example
Sending/Setting
ld a,0 ; Set both lines high out (0),a ld a,2 ; Set tip high, ring low out (0),a ld a,1 ; Set tip low, ring high out (0),a ld a,3 ; Set both low out (0),a
Receiving/Reading
in a,(0) ; Get link port value bit 0,a ; Check tip jr z,tip_low jr nz,tip_high bit 1,a ; Check ring jr z,ring_low jr nz,ring_high