[net.micro] Hayes Smartmodem carrier detect

fair@dual.UUCP (Erik E. Fair) (07/11/84)

>> From: brahms@trwspp.UUCP
>> Newsgroups: net.micro
>> Subject: Hayes Smartmodem carrier detect
>> Date: Mon, 9-Jul-84 18:28:46 PDT
>> Organization: T R W, Redondo Beach, CA
>> 
>> Is there any way to make the Hayes Smartmodem drop carrier detect (pin 8)
>> when it detects loss of signal?  Even a hardware hack would be acceptable.
>> 
>> On page 7-12 of the Hayes manual it states:
>> 
>> 	"The Smartmodem 1200 will always act as if a carrier is present".
>> 
>> This makes it impossible for the system to know if the remote modem has
>> hung up.  Thanx for any help you can give.
>> 
>> 			-- Brad Brahms
>> 			   usenet: {decvax,ucbvax}!trwrb!trwspp!brahms
>> 			   arpa:   Brahms@USC-ECLC

Time for lecture #1 on autodial vs. answer only modems and computer
modem control. First some background on modem control:

Some Definitions:

RI  -> Ring Indicator (Someone is calling us on the phone!)
CD  -> Carrier Detect (Someone is actually there, complete with carrier)
DSR -> Data Set Ready (Hello computer, I'm ready (modem))
DTR -> Data Terminal Ready (Hello modem, I'm ready (computer))

The proper way to do modem control on answering (the electrical signals):

MODEM					COMPUTER
					(periodically scans for RI)
RI (I'm calling yooouooou!)
					DTR (OK, answer the phone)
DSR (OK, I'm answering the phone)
					(wait for CD)
CD (Someone is giving us a carrier)
					(print login banner and converse)
					``Frobozz Inc 4.2 BSD UNIX''

This sequence gives maximum control of the modem and the conversation
to the computer. Among other advantages, the modem will not answer the
phone when the computer is down or if the software has been told not to
answer.  Most computers on the low end of the price spectrum, however,
do things this way:

MODEM					COMPUTER
					DTR (``always answer the phone'')
					(periodically scans for DSR)
RI (I'm calling yooouooou!)
DSR (OK, I'm answering the phone)
CD (Someone is giving us a carrier)
					(print login banner and converse)
					``Frobozz Inc 4.2 BSD UNIX''

Note that the computer doesn't care about CD. It watches for
transitions in DSR signal instead. Since answer-only modems of recent
manufacture seem to raise and lower DSR along with CD, this is not a
problem. It does tend to make the hardware in the serial interface and
the software a little easier to deal with, since all you do is tweak
DTR and watch DSR.

What does this have to do with autodialing modems and such? Well hold on,
I'm getting to that...

With new autodial modems you have a paradox. You have to converse with
the modem before there is actually someone there (remotely, that is) in
order to get it to dial. In order to fool the computer (particularly
one that follows the poor man's modem control as detailed above), the
modem must assert DSR whenever DTR is asserted, in order to let the
computer talk to it. With the rich man's modem control, and depending
upon the sophistication of the software, you should be able to tell the
difference between talking to the modem (DSR only) and someone remote
(DSR and CD both asserted).

HOWEVER! Should you desire that your extremely intelligent autodialing
modem should only answer the phone (and that you should be able to tell
when someone has hung up), what you need to cause the modem to do
(particularly with poor man's modem control) is to raise and lower DSR
along with CD. Note, however, that this effectively prevents
autodialing, because you will only be able to talk to the modem when
someone is there on the other end. I believe that the DC Hayes
Smartmodem 1200 has this as a configuration option somewhere on the
back dip switches if you read the manual very carefully. If not, I
suggest that your login process have a 5 min timeout after which the
computer will drop DTR to get the modem to hang up the phone. If your
modem won't do that, then you're really out of luck...

To reconsider this statement:

>> On page 7-12 of the Hayes manual it states:
>> 
>> 	"The Smartmodem 1200 will always act as if a carrier is present".

I interpret this to mean that DSR will always be raised when DTR is asserted
by the computer in order that you can talk to the modem to get it to dial.

	another eddy in the muddy waters...

	Erik E. Fair	ucbvax!fair	fair@ucb-arpa.ARPA

	dual!fair@BERKELEY.ARPA
	{ihnp4,ucbvax,hplabs,decwrl,cbosgd,sun,nsc,apple,pyramid}!dual!fair
	Dual Systems Corporation, Berkeley, California

hoffman@pitt.UUCP (07/11/84)

But it *does* toggle pin 8!   You quoted only one sentence from
page 7-12 in the Smartmodem book.  THE VERY NEXT SENTENCE answers your
question.  Here's the whole paragraph:

Setting S10 to 255 will cause the Smartmodem 1200 to ignore carrier
detect status.  The Smartmodem 1200 will always act as if carrier is
present.  However, the CD indicator light and the RS-232C Carrier Detect
line will follow the true carrier status.

What all this means is that if you set S10 to 255, then the modem
does not hang up on carrier loss, but indicates the loss through
pin 8.  It's up to your program to sense this and drop DTR and
hang up the phone.
-- 
Bob Hoffman
Pitt Computer Science

msc@qubix.UUCP (Mark Callow) (07/11/84)

I don't know what you were smoking when you read the manual....

If you set dipswitch 6 down you get the behaviour you mention.
If you set dipswitch 6 up pin 8 will folow the state of the carrier
on the phone line.

Read Table 3 on pages 8-3 and 8-4 of the manual.

You took the statement

	"The Smartmodem 1200 will always act as if a carrier is present".

totally out of context.  It was describing the behaviour when
you set the timeout value in *register* s10 to 255.

	Mark
-- 
From the TARDIS of Mark Callow
msc@qubix.UUCP,  decwrl!qubix!msc@Berkeley.ARPA
...{decvax,ucbvax,ihnp4}!decwrl!qubix!msc, ...{ittvax,amd70}!qubix!msc

"Nothing shocks me.  I'm an Engineer."

john@ecsvax.UUCP (07/12/84)

If you set Switch 6 on the Hayes UP, the modem will
"determine if a carrier signal is coming from a distant
modem by reading the status of the RS232C Carrier Detect lead
(pin 8)." (page 8-3 of the manual)

It is only if you set register S10 to 255 that the modem will
ignore carrier detect status.  Register S10 "Sets [the] time
between loss of carrier (distant modem hangs up) and disconnect
by Smartmodem 1200" (page 7-12).  Setting S10 to less than 255
will allow the modem to react to loss of carrier.  The default for
S10 is 7.

john hogan
nc educational computing service
rtp, nc 27709
 (919) 549 0671

  ...decvax!mcnc!ecsvax!john
   ...akgua!mcnc!ecsvax!john

perl@rdin.UUCP (Robert Perlberg) (07/12/84)

<>

What we have here is a case of misreading.  Here is the complete
manual entry:

Page 7-12:

This delay time allows the carrier to momentarily disappear without
causing the modem to disconnect.  The value assigned to S10 is
adjustable in tenths of seconds.  The default value is 7 for
a delay time of 700 milliseconds.

Setting S10 to 255 will cause the Smartmodem 1200 to ignore carrier
detect status.  The Smartmodem 1200 will always act as if a carrier
is present.  However, the CD indicator light and the RS-232 Carrier
Detect line will follow the true carrier status.

end_of_extract

Need I say more?  If you had taken the time to read the whole
paragraph instead of just one line you would have seen that the
statement in question is conditional on your setting S10 to 255,
a very special case.  Not only that, the last sentence indicates
that the RS-232 carrier detect line will ALWAYS indicate carrier
detect whether you are using this option or not.

If your carrier detect line is always TRUE, it might be because
dip switch #6 is down (see page 2-6).

Robert Perlberg
Resource Dynamics Inc.
New York
philabs!rdin!perl

brahms@trwspp.UUCP (07/12/84)

[}{]

When I sent out my original message stating my problem with carrier detect,
I failed to add that I had set pin 6 correctly, thus leading to my query.

As of this point in time, I believe that the modem was bad.  I will be trying
another one shortly to see if the problem goes away.

Thank You to all of you who replied.

			-- Brad Brahms
			   usenet: {decvax,ucbvax}!trwrb!trwspp!brahms
			   arpa:   Brahms@USC-ECLC