Re: TI-85 link port in asm


Re: TI-85 link port in asm

>Here's a few questions concerning programming the TI-85 link port in
>assembly (on a non-turboed calculator, using ZShell):
>- How fast can you send/receive, bits per second, error free --- in
>  practice, not theoretically?

It depends on your protocol.  Using a protocol similar to RS232 you
can probably get something like 70 to 100 kbits/sec.  But the
receiving device must be a *fast* microprocessor controlled device
(i.e. something faster than another TI-85, etc.) in order to achieve
the such a protocol, otherwise asynchronous protocols will limit you
to somewhere around 50 kbits/sec max.  The expander SF gets about
40000 kbits/sec with the (somewhat inefficient) SPI protocol.  If you
use the actual TI protocol used with the parallel link and
calculator-calculator transfers, you'll be lucky to get 15000
kbits/sec due to the highly innefficient nature of the protocol.

Basically, the linkport cannot be run at "full" processor speed.
There needs to be a minimum delay of approximately 2 to 4 microseconds
inbetween switching of linkport states, otherwise errors will result.

>- What is the shortest and most accurate time that can be used as a delay,
>  say, using the instruction execution speeds?

The NOP ("no operation") instruction in the Z80 takes up approximately
664 nanoseconds on a 6 MHz clock, but this is somewhat innaccurate
since the TI-85 clock is not crystal/resonator based (i.e. that time
can vary widely depending on temperature and battery drain).

>- Is there a list of Z80 instruction execution times available somewhere?

All Z80 instructions are measured in terms of both "T-States" and
"Machine cycles".  Really though, only the T-State measurement is
usefull.  Instructions take up anywhere from 4 to 21 T-States, where 1
T-State = 1/freq = 1/6MHz = 166 nanoseconds.  So a z80 instruction
that is 10 T-States has a 10*166ns = 1.66 microsecond execution time.
The number of T-States per instruction is listed in most Z80 assembly
language references.

>- Does the execution speed of an assembly program depend on the amount of
>  free memory the way it does in basic and everything else?

No, execution speed is solely dependant on battery life (for the
TI-85) and temperature.  This is because the clock is based on an RC
network which is both battery life and temperature dependant, and can
vary as much as 20% (estimated) in either direction.  It is highly
innaccurate compared to the crystal clock present in most
microprocessor devices (which never varies more than like 0.001%).

Execution speed is also dependant on whether the interrupts are set
because the interrupt timer in the TI-85 is set to execute about 200
times per second, somewhat slowing down execution speed, although this
is usually negligible.

>- Is it possible to forbid interrupts in a program w/o crashing the calc
>  and still use the link port?

Interrupts have no bearing on linkport operations, I believe.