Article 44836 of comp.sys.cbm:
Xref: undergrad.math.uwaterloo.ca comp.sys.cbm:44836
Newsgroups: comp.sys.cbm
Path: undergrad.math.uwaterloo.ca!csbruce
From: csbruce@ccnga.uwaterloo.ca (Craig Bruce)
Subject: Even swifter
Sender: news@undergrad.math.uwaterloo.ca (news spool owner)
Message-ID: <DHvn2z.G6q@undergrad.math.uwaterloo.ca>
Date: Sat, 11 Nov 1995 11:40:11 GMT
Nntp-Posting-Host: ccnga.uwaterloo.ca
Organization: University of Waterloo, Canada (eh!)

I have just made a trivial but important hardware hack to one of my (two)
SwiftLink cartridges to see if I could make it go faster, and IT DOES!

As anyone who has read the SL technical documentation knows, CMD chose to
use a double-speed clock crystal in the SL in order to allow it to work at
speeds up to 38,400 bps, doubling the maximum baud setting for the 6551 chip
of 19,200 bps ($0f in the control register).  For the general purposes for
which the SL is intended, this was an excellent design decision.

However, the 6551 also has the ability to use 1/16x the external clock rate
in order to generate "non-standard" baud rates (well, non-standard in 1987),
for rates up to 125,000 bps.  The speed of the double-speed clock crystal is
3.6864 MHz, so 16x slower than this is 230,400 bps.  I tried this rate out
and it didn't work at all.

I replaced this crystal with a 1.8432 MHz crystal, which is the standard
frequency for serial-chip crystals.  One 16th the rate of this crystal is
115,200 bps, which is both below the 125,000-bps limit of the 6551 and is a
standard serial speed for newer, high-speed modems, such as my USRobotics
28.8 Sportster.

I tried it out and it works; I can communicate with my modem successfully at
115,200 bps using ACEterm on a 2-MHz C128.  Well, mostly.  The problem with
such a high baud rate is that 11,520 interrupts per second have to be
handled by the processor, which means that each interrupt must be handled in
177 clock cycles (at 2 MHz).  ACE can normally handle this (much to my
surprise), but occasionally it cannot and so it gets trampled by interrupts
and crashes.  This apparently happens when it is about to assert hardware
flow control.  I should be able to tune the interrupt routines to always be
able to handle this baud rate.  This baud rate doesn't work at all with the
processor at 1 MHz--ACEterm crashes immediately.  It is likely that this
baud rate will work perfectly with the upcoming Super-64 accelerators from
CMD.

However, if you are interested in making this hack, there is a price to be
paid: you gain the ability to work at 115,200 bps but you lose the ability
to work at 38,400 bps.  The second highest speed of the SL becomes 19,200
bps with this hack.  It may be possible to install a switch to select
between the two crystals, if this doesn't cause too much capacitance/
inductance/whatever.  Also, any hack, of course, voids any warranty.

The reason that I wanted to make this hack is that with my 28,800-bps modem,
the standard rate for transferring regular text is about twice this, or
57,600 bps.  So, there are actual gains to be made here.  I also like to
tell my PC-using friends to "get a _REAL_ computer!".


Keep on Hackin'!

-Craig Bruce
csbruce@ccnga.uwaterloo.ca
"Efficiency usually scales up, but waste doesn't scale down."


