Subject: Re: Still disconnecting...
To: port-mac68k <port-mac68k@NetBSD.ORG>
From: Rolf Braun <rbraun@geocities.com>
List: port-mac68k
Date: 04/01/1997 16:04:08
>>> Thanks for the response.  I understand crtscts and mdmbuf, but why should
>>> my modem ignore change in dtr?  Would dtr ever drop when using pppd?
>>
>>The Mac serial ports only have one "handshake out" pin; most of the cables
>>I've seen wire that pin to both DTR and RTS (or is it CTS? I always
>>confuse those two :) In any case, unless you set your modem to ignore DTR
>>(at&d0, usually), there's a chance that it'll hang up when you don't want
>>it to. Alternatively, you could increase the value of some S register that
>>specifies how long DTR must be low before the modem hangs up, although
>>there'd still be the chance of an accidental disconnection.
>
>I believe there was a time when the Apple recommended Hardware Handshake
>cable had CTS tied to DTR, and some modem companies still deliver this
>configuration.  US Robotics is one I think.  The current Apple
>recommended Hardware Handshake cable has RTS tied to DTR, and this is the
>cable you'll most likely get from places like Best Buy, Compu USA and
>most modem manufacturers.  In an ideal world one signal is used for
>in-bound flow control and the other is used for out-bound flow control.
>As Dave says, the Mac can only support one, not both. And just like Dave
>I can't remember if RTS is in-bound or out-bound, but disabling DTR might
>just solve you disconnection problem.

OK, here's the scoop on hardware handshaking:

In an ideal world, you have at least 8 pins on an RS-232 serial cable. The
standard PC 9-pin serial cable includes the following pins (not in order),
and the 25-pin cable has even more, mostly useless:

Electrical Ground
 - completes circuit for the rest of the pins

Receive Data
 - guess what this does

Transmit Data
 - guess again

RTS (Request to Send) Hardware Handshaking
CTS (Clear to Send) Hardware Handshaking
 - These are the standard handshaking signals by which the computer and the
peripheral tell each other to shut up. RTS is controlled by the computer
and tells the modem (or whatever) to shut up, and CTS is controlled by the
modem and tells the computer to shut up. (signal up = allow data flow,
signal down = shut up)

DTR (Data Terminal Ready) Hardware Handshaking
DSR (Data Set Ready) Hardware Handshaking
 - This is another set of hardware handshaking signals. DTR corresponds to
RTS, and DSR corresponds to CTS. These aren't used for their intended
purpose, however, because RTS and CTS already exist. DSR isn't used, for
the most part. However, DTR is used by the computer to tell the modem to
hang up. (signal up = keep connected, signal down = hang up)

DCD (Data Carrier Detect) Hardware Handshaking
 - This is used by modems to tell computers whether they're connected or
not. It provides very nice hangup detection. Unfortunately, Mac modem
cables often don't support this signal, and Mac software usually doesn't.
(signal up = connected, signal down = not connected)

RI (Ring Indicator)
 - This is supposed to be a ring indicator. I've never seen this used.

The pins above total 9; minus the unnecessary Ring Indicator, 8. Mac serial
cables/ports have 8 pins; however, Mac serial ports aren't RS-232. They're
a superset standard (RS-422 or something like that) that uses 2 additional
pins to provide clearer communicaton over longer serial cables. Thus, two
handshake pins can't be used.

The solution currently used is to put RTS and DTR on one pin (HSKo or
Handshake Out I think) and CTS and DSR on another (HSKi or Handshake In
probably). DCD is renamed to GPi (General Purpose Input).

DSR and CTS happily co-exist, because DSR isn't used. However, RTS and DTR
are both used by computers to send signals to modems, so this is a problem.

- Rolf Braun ... rbraun@geocities.com ... TidalWave on IRC
- Sassy Software: cool stuff for Macintosh & Apple II
- http://www.geocities.com/SiliconValley/Heights/3110/