Shop OBEX P1 Docs P2 Docs Learn Events
The elephant project is done, but... — Parallax Forums

The elephant project is done, but...

Del OgrenDel Ogren Posts: 7
edited 2006-05-13 20:46 in BASIC Stamp
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?

·

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-05-12 16:07
    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 OgrenDel Ogren Posts: 7
    edited 2006-05-12 21:56
    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?

    ·
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-05-13 20:46
    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.
Sign In or Register to comment.