PDA

View Full Version : The elephant project is done, but...



Del Ogren
05-12-2006, 08:29 AM
Friends.

Due to some minor technical problems, and human scheduling confusions,
I now have a bit of·time to add some bells and whistles to the elephant project.

Does anyone have a trick for detecting whether or not a serial cable
is connected?

I'd like to do that to make the user interface a bit more friendly.
Like:
If plugged in = yes
· goto menu
else
· goto just-run

Any ideas?
tnx,
--del



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Which end do end-users use?

·

allanlane5
05-13-2006, 12:07 AM
Typically you'd have a SERIN with a time-out at the start of your program. You might even have a SEROUT prompt, followed by a SERIN with a timeout.

If you have a terminal connected, when you see the prompt enter a 'return'. If the SERIN doesn't time-out, output the menu. If it DOES time out, you're running stand-alone, and should run your program.

Del Ogren
05-13-2006, 05:56 AM
Yep, Allan,

I thought about doing it that way. But I didn't like the notion of the user having to wait
for a timeout in stand alone mode. That and adding another LED to to the box that
says, "OK I'm ready to work now." Though that's what I might end up having to do.

But then I started doing what we all dread, RTFM....

The schematic for the carrier board seems to indicate a loop-back on pins 6 and 7
(DSR and RTS ?) of the DB 9 connector. Has anyone tried looking at the voltage
on that loop-back to determine if a host computer is attached? I might study that
a bit later this evening.

And, I suppose I gotta ask the end users if they want it to be done at all...

--del

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Which end do end-users use?

·

allanlane5
05-14-2006, 04:46 AM
Well, you could use a 1 second time-out, which is very short, and the idea is that the user wouldn't press the 'reset' button until they're ready to talk to the unit.

The loopback on pins 6 and 7 is 'hard-wired' close to the connector, but I suppose you could add a jumper resistor (of 22 Kohms) to read that voltage. Clever.