Article View: comp.os.ms-windows.programmer
Article #20Re: Does anyone know how to switch individual serial port lines on/off ?
From: eric schonning
Date: Thu, 16 Nov 1995 02:56
Date: Thu, 16 Nov 1995 02:56
37 lines
2710 bytes
2710 bytes
Rod Sherwin (cypher@internetnorth.com.au) wrote: > m.ballard@chem.csiro.au (Mat Ballard) wrote: > >i need to switch an individual serial port line on and off: ie: > >make pin #1 +5V, and pins #2 - #37 0V. > Did anyone have a sensible answer to this question - or was everyone > too busy pulling apart the semantics of his question. Well you have to admit it was pretty funny. I got a good laugh out of it, or at least the replies. The serial port does not put out +5v, the RS-232 lines run between +/- 10 to 15v I think. But you can use a chip like the MAX232 to bring the rs232 levels down to logic (0 and +5) levels. There is another version called the MAX233 (I think that is the #) that requires no external components, and is a few $ more (diff of $3 for 232 and $6 or so for 233). Far better method however would be to just use the parallel port, which outputs TTL level signals and also has TTL input so doesn't need any glue chips, unless you plan on driving something in which case you could hook up the appropriate chip or transistor (I always use Darlingtons). But if your just going to interface to another IC then just hook right to it. Simple port I/O commands like INP and OUT in BASIC can be used to read and write to the parallel port, and you can turn off and on whichever bits you want quite easily. Note you can also use INP and OUT with the serial port as well, and turn on bits like DTR and RTS, but you don't have nearly as many as you do on the parallel port and as stated before you would have to run them thru a rs232-to-logic level ic anyways in order to use them as per the initial example. > This type of serial port control is important for device control, and > some people might actually be interested in a serious answer. It is, and when I first was doing interfacing thought of the serial port as well since it was all I really knew. But now that I know better I always think of the parallel port first, next game port and last serial port unless its already an rs232 device. Eric
Technical Details
Message-ID:
<48e98a$ns3@dewey.csun.edu>Path:
arc1-ca.pugleaf.net!csun.edu!hbcsc388References:
<476c4i$op9@news.dmpe.CSIRO.AU> <47p2at$7h7@dingo.cc.uq.oz.au>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!csun.edu!hbcsc388 From: hbcsc388@csun.edu (eric schonning) Newsgroups: comp.os.ms-windows.programmer,comp.lang.c,comp.lang.basic,comp.lang.basic.misc,comp.lang.basic.visual.misc Subject: Re: Does anyone know how to switch individual serial port lines on/off ? Followup-To: comp.os.ms-windows.programmer,comp.lang.c,comp.lang.basic,comp.lang.basic.misc,comp.lang.basic.visual.misc Date: 16 Nov 1995 02:56:10 GMT Organization: California State University, Northridge Message-ID: <48e98a$ns3@dewey.csun.edu> References: <476c4i$op9@news.dmpe.CSIRO.AU> <47p2at$7h7@dingo.cc.uq.oz.au> NNTP-Posting-Host: louie.csun.edu