Shop OBEX P1 Docs P2 Docs Learn Events
Interfacing with DTR line of a serial device — Parallax Forums

Interfacing with DTR line of a serial device

ArmageddonArmageddon Posts: 6
edited 2006-07-02 12:28 in BASIC Stamp
··· I'm interfacing a basic stamp with a Lacross weatherstation.· The weatherstation console·has a serial port for connection to a PC.··The protocol requires asserting the DTR line·at the beginning of communication and releasing it at the end of communication.· I know for RS232 the in and out·lines need to be passed through a RS232 level converter or use the·basic stamp dedicated serial pins.· What I don't know is if lines like DTR also need to be pased through a level converted or if they use TTL levels. Any help is appreciated.·

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-07-02 07:46
    Armageddon -

    It's customary to pass all RS-232 propagated pins and signals through a level converter (such as a MAX-232) when any are required. This is why they make such converters with more than just two (Tx, and Rx) "channels". Thus, if you were to use (actual) handshaking, you would pass those lines through as well.

    WARNING: DO NOT use pin port 16 or DEBUG for this application when connected to the unit in question. A number of unnecessary and time consuming surprises will be in store!

    Bring the control line (DTR) along as noted above, through the level converter to a PBASIC Stamp pin port (other then 16), and use a HIGH command during command processing, and then de-assert it with a LOW command after command processing is finished. Insofar as you are concerned in your program, it's just another control line that needs to be manipulated.

    Slightly strange business, but simple enough to accomodate smile.gif

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • stamptrolstamptrol Posts: 1,731
    edited 2006-07-02 12:28
    The other thing you can do is use a separate Stamp output to apply +5 to the DTR line via a small relay. Your program would assert DTR before the serial communication then let it go at the end of communication.
    I've used this technique for many years with industrial truck scale systems.

    Cheers
Sign In or Register to comment.