Subject: Re: Connecting UPS to a mac....
To: Henry B. Hotz <hotz@jpl.nasa.gov>
From: David A. Gatwood <marsmail@globegate.utm.edu>
List: port-mac68k
Date: 06/12/1997 12:57:55
On Thu, 12 Jun 1997, Henry B. Hotz wrote:

> So they don't get to hear from me.  Their loss.

:-)  Great attitude.  :-)

> >First, I'm assuming that the handshaking inputs generate an internal
> >voltage of 5v or so and wait for that to be pulled low, right?  Assuming
> >that's valid, the UPS shorts the pin to a second one in order to pull it
> >low, but it appears that the grounding has to be done in the cable.
> >Should there be a resistor on either side to prevent the handshaking pin
> >from being completely grounded, or is that within spec?
> 
> First the "official" answer:  The interface uses RS-232 voltage levels,
> therefore valid states are between 3-25 volts + or -.  Between -3V and +3V
> is undefined.
> 
> Now a more realistic answer:  There is *usually*but*not*always* a bias in
> the detection threshold so a shorted input does not generate random
> garbage.  I don't know what the Mac does, but the default "unbiased"
> threshold for the usual interface chip is the normal TTL threshold  (is
> that 1.4 V?  I forget.)

So it might be usable to switch between say +5V and ground, depending on
the interface design on the PowerMac 7600....  I suppose the only way to
know for sure whether that works is to try it, right?


> How safe the sleep() call is depends on how much your machine is swapping.
> In any case small processes are less likely to get swapped.  Are all the
> syscalls that would allow you to lock yourself in memory restricted to the
> kernel, or can you do something if you're root?

Good question.  I'm curious about powerd.  That might handle everything
software-wise well enough, though I'm not sure.  According to its manual
page, it checks the DSR line to see if it's high, and it should be
"directly conneted to the DTR line", which it always keeps high, so if DSR
goes low, it emits warnings (i.e. that the line voltage has failed).  It
also checks DCD and if it goes low, it shuts the machine down.  Sounds
like it does everything I need, software-wise.  The big question remaining
is what linux does on powermacs that don't have as many handshaking
inputs.  I can only assume that they treat RTS/DTR together and DSR/CTS
together like Mac Modem cables are typically wired (at least that's the
way I interpret Bill Studenmund's letter of... April 1... to this list....
:-)  If not, I guess I'll write my own program.


David