home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / telecomm / neocom / div_prg / turbocts / turbocts.doc next >
Text File  |  1993-10-21  |  9KB  |  199 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                    TURBO CTS
  9.                                  Version 1.32
  10.                        Copyright (C) 1989 by Bill Penner
  11.  
  12.  
  13.          First  a  statement:   USE  THIS  SOFTWARE AT YOUR OWN RISK!  THIS
  14.     PROGRAM  MAY  BE  FREELY  DISTRIBUTED  AS  LONG  AS THE PROGRAM REMAINS
  15.     UNMODIFIED  AND  THIS  DOC FILE REMAINS WITH THE PROGRAM.  THIS PROGRAM
  16.     MAY  !!NOT!!  BE SOLD, HOWEVER, MAY BE INCLUDED ON CLUB DISKS WHICH ARE
  17.     SOLD  FOR  A  SMALL  FEE.   YOU  USE THIS SOFTWARE AT YOUR OWN RISK.  I
  18.     ASSUME  NO RESPONSIBILITY FOR ANY LOSS, DIRECTLY OR INDIRECTLY FROM USE
  19.     OR POSSESION OF THIS PROGRAM.
  20.  
  21.          Since  the  ATARI  ST  was  released in 1985 the computer has been
  22.     advertised  as  supporting  RS-232  Clear  to  Send and Request to Send
  23.     (CTS/RTS)   protocol.   The  truth  is  that  the  computer  never  has
  24.     sucessfully  supported this.  Even with the changes taking place in TOS
  25.     1.4,  the  April version of the ROM's still contain several bugs in the
  26.     RS232 routines which have made RTS/CTS flow control inoperative.
  27.  
  28.          Currently  most  RS-232  interfaces only require three wires to be
  29.     connected  between  the  computer  and a peripheral (such as a modem or
  30.     serial printer).  These lines would be the transmit data, receive data,
  31.     and  ground.   The  transmit data line would carry the information from
  32.     the computer to the peripheral device and receive data would bring data
  33.     into  the  computer  from the peripheral.  Some devices operate slowly,
  34.     such  as  printers,  and the computer can send out data faster than the
  35.     device  can  use  it.   To  be  able  to work best with a computer, the
  36.     external  device  normally uses some form of buffering to store several
  37.     bytes  (characters)  of  data (sometimes up to 256K bytes or more).  If
  38.     the  buffer was always larger than the amount of information no problem
  39.     would occur, but most devices will allow you to send more data out than
  40.     the  buffer  would  be  able  to  hold.   To  handle  this,  a  form of
  41.     "handshaking"  is  required.   For  the  RS-232  interface  one  of two
  42.     protocols  of  handshaking  are  normally  used.   Currently,  the more
  43.     popular  one is the XON/XOFF protocol.  In this protocol, when a buffer
  44.     is  nearly  full, the device will send out a character as would be sent
  45.     out by pressing Control and S (Ctrl-S).  When the buffer has emptied to
  46.     some  point, the device will send out a Ctrl-Q to tell the other device
  47.     to  start sending again.  Communication with most BBS's will also allow
  48.     the  user  to  stop the sending of text from the BBS by pressing Ctrl-S
  49.     from  the  terminal  and  then  Ctrl-Q to continue the text again.  The
  50.     other protocol is an older one in which two more wires are added to the
  51.     RS-232 interface for RTS and CTS signals.  These operate similar to the
  52.     XON/XOFF  protocol  except  that instead of sending some data back down
  53.     the  line  to  tell  the  other  device to stop sending data, a line is
  54.     changed  from  low  to  high.  The line being sent from the computer to
  55.     tell  an  external  device  to  stop  sending is called Request to Send
  56.     (RTS).  The line coming from an external device to the computer to tell
  57.     the computer to start or stop sending is called Clear to Send (CTS).
  58.  
  59.          With   most   peripheral   devices   being   smart   (based  on  a
  60.     microprocessor  or microcontroller), and the serial speeds being fairly
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.     slow  (110 to 9600 baud), XON/XOFF was easier to implement and required
  74.     less   hardware.   But,  now  with  modem  speeds  increasing,  several
  75.     companies  are implementing RTS/CTS flow control.  The US Robotics 9600
  76.     and  14400  baud  modems  have  MNP data compression available when the
  77.     modem  to computer RS-232 speed is set at 19200 baud, but to handle the
  78.     19.2K  baud  speed,  the modem uses RTS/CTS flow control.  The ATARI ST
  79.     ROM's  have pretended to support this mode, but bugs in all versions of
  80.     TOS have prevented RTS/CTS from working, including the April version of
  81.     TOS 1.4 ROM's.
  82.  
  83.          Upon  the  request  of Don P. (STARBASE), I began to work on a fix
  84.     for the problem.  At first glance the problem was a simple one, only to
  85.     trap  the  characters  being  sent to the modem and check for CTS being
  86.     low.   I  wrote  a  couple of accessories and programs which did this.
  87.     They  were  called  CTSFX100,  CTSFX101,  CTSFX102,  and CTSFX103.  The
  88.     result is that they worked for some pieces of software like Flash and a
  89.     couple  of  other  problems.   While  working  on  the  program,  I was
  90.     optimising  routines and making the program faster.  This only resulted
  91.     in  showing  that my method of fixing the problem was greatly in error.
  92.     I  was  simply  grabbing  the characters as they were being sent to the
  93.     output  buffer  and  between the operating system, my software, and the
  94.     terminal or BBS program, the transfer speed was less then 19200 baud so
  95.     the  buffer  would  never get filled up and my filter was working.  But
  96.     after  optimising several portions, the speed increased to the point of
  97.     making  my  program  useless  since the buffer would fill up the output
  98.     buffer  and when CTS changed, my program would stop placing data in the
  99.     buffer,  but  then  the computer would continue to send out the rest of
  100.     the  buffer.  In the documentation I wrote with the program, I included
  101.     my  phone  number.   The  program was distributed on F-Net and within a
  102.     couple  of  days,  I  had  received  many  phone calls about fixing the
  103.     problem.
  104.  
  105.          I  have  been working on the problem for a couple of weeks now and
  106.     have  come  to  understand  that the problem has been around for a long
  107.     time,  and  little  has  been  done  to  resolve the problem.  The data
  108.     compression  mode of the US robotics was not able to be used and people
  109.     were  relying on ATARI to eventully fix the ROMs.  After generating the
  110.     CTS  Fix  programs,  alot of interest was stirred up to fix the problem
  111.     and it appeared to be time to fix the problem, once and for all.
  112.  
  113.          The  approach was to take a close look at TOS 1.4 and to determine
  114.     why  it  didn't  work.   I  found  only  three  minor problems with the
  115.     software.   Two problems had to do with the software not being properly
  116.     initialized  and  a bug in the Rsconf() routine which would not let you
  117.     set  CTS/RTS  mode.   I  was  able to get the RTS/CTS to work PERFECTLY
  118.     simply  by properly initializing the MFP CTS active edge register based
  119.     on  current  CTS level, initializing a system variable which is used to
  120.     tell  the  software  if the transmit port was enabled or disabled (also
  121.     based  on  current  CTS level), and then setting the system variable to
  122.     enable  CTS/RTS.  Programs would work just fine until they tried to set
  123.     the  flow control, which would disable CTS/RTS and cause XON/XOFF to be
  124.     enabled or disabled.
  125.  
  126.          A final program was written to replace the RS-232 routines used by
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.     the  system.  This was the only way to create some software which would
  140.     work  with  any  version of ROMs.  Since the other modes of handshaking
  141.     worked  just  fine,  I decided to write some RS-232 routines which were
  142.     optimized  for  CTS/RTS  flow  control in hopes of also speeding up the
  143.     RS-232 routines.  The resultant program is called TURBOCTS.PRG.
  144.  
  145.          TURBOCTS  is  a program which can be either autobooted or run when
  146.     the  RTS/CTS flow control is needed.  Once the program has been loaded,
  147.     the  RTS/CTS  mode is enabled and can not be disabled without rebooting
  148.     the  system.   The Rsconf() command can be used to set the RS-232 speed
  149.     and  play  with the UART registers, but flow control settings will have
  150.     no  effect.  The program will also properly trap the printer operations
  151.     when  the  printer  output  is  sent  to  the RS-232 port as set in the
  152.     control  panel  or  the Setprt() command.  In beta testing, the program
  153.     has  resulted  in  increasing the average Zmodem transfer speed on a US
  154.     Robotics  9600  baud modem communicating with the ST at 19.2 Kbaud from
  155.     approximately  850  characters  per second (CPS) to 1100 CPS for nearly
  156.     30% improvement.
  157.  
  158.          Note  for  PC Pursuit Users:  You can continue to use the software
  159.     when calling through telenet.  At the @ prompt, type:
  160.                       @set ? 1:0,4:10,5:1,7:8,12:1 <ret>
  161.     During beta testing, a 20 CPS speed increase was noted using TURBOCTS.
  162.  
  163.          I would like to thank Don P (Seattle) and  Mark A for the support,
  164.     suggestions,  and  information.  I also appologize for distributing the
  165.     real  lousy  version  of  CTSFX10x  which  worked  for  some and caused
  166.     headaches  for  others.   If  you  have  a  copy  of CTSFX10x please do
  167.     everyone  a  favor  and  erase  it  (besides, TURBOCTS works better and
  168.     faster!).
  169.  
  170.          If  you  have  any  problems  with  the  program, please send me a
  171.     message  on  GEnie  (BPENNER)  or  by mail at: Bill Penner, 3235 Wright
  172.     Avenue, Bremerton, WA  98310.
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.