[TI-H] Re: Low Level Link Port Programming


[Prev][Next][Index][Thread]

[TI-H] Re: Low Level Link Port Programming




The TI link protocol uses two wires (for data, obviously three are needed
with ground) in order to avoid having the protocol depend on timing (think
about how it would have to work with only one wire).  The TI link protocol
is decent, and probably the easiest way to interface with the calculator.
Once you get the concepts down, it's fairly easy to work with.  If you don't
have the luxury of controlling the protocol of your other device, then of
course this doesn't apply.

The text below is from the ports section of the Assembly Studio 8x help file
(an excellent source for info on all z80 calculators):

--- Paste starts here ---

Port 7 - Link port control

This port is used to read or set the state of the two link port wires.

Write: 11....00

Bits 2 & 4 - 1: makes red wire inactive
  0: makes red wire possibly active if other calc says so
 Bits 3 & 5 - 1: makes white wire inactive
  0: makes white wire possibly active if other calc says so

Read: 0000....

Bit 3 - 1: white wire current stopped because this calc said so
  0: white wire possibly active
 Bit 2 - 1: red wire current stopped because this calc said so
  0: red wire possibly active
 Bit 1 - 1: white wire active
  0: white wire inactive
 Bit 0 - 1: red wire active
  0: red wire inactive

Examples:

To turn on certain wires, do the following:
 ld a,%11010100 ;White wire ON
 out (7),a
 ld a,%11000000 ;White wire ON, Red wire ON
 out (7),a
 ld a,%11101000 ;Red wire ON
 out (7),a
 ld a,%11111100 ;nothing ON
 out (7),a

To check if certain wires are turned on, do the following:
 in a,(7)
 and %00000011 ;only the lower two bits matter
 cp 3 ;Bits 0 and 1 set
 jr z,BothActive
 cp 2
 jr z,WhiteActive ;Bit 1 set
 cp 1
 jr z,RedActive ;Bit 0 set

cp 0
 jr z,NoneActive ;Neither bits set

See the file Link86.asm in the Samples folder for an example routine to send
and receive bytes through the link port.

--- Paste ends here ---

> Which apparently outputs a 1 and 0.  However, this would only use one line
if
> I am correct.  I am trying to interface to a device without using TI's
> standard link-port protocol.





References: