Truncated match.
PICList
Thread
'Putting RS232 TX line high'
1998\03\10@144919
by
Craig Webb
Does anyone know off-hand the memory address and value for setting the RS232
TX line high on a PC? I need to trigger a relay connected to this line.
Thanks.
C. Webb
1998\03\10@162510
by
B‡rdos Csaba
|
At 14:14 3/10/98 -0500, you wrote:
>Does anyone know off-hand the memory address and value for setting the RS232
>TX line high on a PC? I need to trigger a relay connected to this line.
>
>Thanks.
>
>C. Webb
Hi,
First of all, what do you mean HIGH on TX line on RS232 port of PC ?
The TX and RX lines (in RS232) are not on TTL level.
The 'logic 1' on TX (idle state) means this line is about -12V respect
to ground, the 'logic 0' on TX (mark state) means this line is about +12V
respect to ground.
Apart from this, you can't change the state of TX in this way (to control
relay).
Instead of TX, use the RTS or DTR signal.
These signals are TTLs, and it is easy to use as general purpose bits.
To change these signals, set or clear the appropriate bit:
(DTR)
[baseaddr+4].0 (ie. base address of serial port, eg. com1=0x3f8,
so the appropriate bit is the lsb of 0x3fc)
(RTS)
[baseaddr+4].1 (ie. base address of serial port, eg. com1=0x3f8,
so the appropriate bit is the second bit of 0x3fc)
bye
csaba
1998\03\10@164252
by
myke predko
|
Craig Webb wrote:
>At 14:14 3/10/98 -0500, you wrote:
>>Does anyone know off-hand the memory address and value for setting the RS232
>>TX line high on a PC? I need to trigger a relay connected to this line.
>>
>>Thanks.
>>
>>C. Webb
The Csaba replied with:
{Quote hidden}>Hi,
>First of all, what do you mean HIGH on TX line on RS232 port of PC ?
>The TX and RX lines (in RS232) are not on TTL level.
>The 'logic 1' on TX (idle state) means this line is about -12V respect
>to ground, the 'logic 0' on TX (mark state) means this line is about +12V
>respect to ground.
>Apart from this, you can't change the state of TX in this way (to control
>relay).
>Instead of TX, use the RTS or DTR signal.
>These signals are TTLs, and it is easy to use as general purpose bits.
>To change these signals, set or clear the appropriate bit:
>(DTR)
>[baseaddr+4].0 (ie. base address of serial port, eg. com1=0x3f8,
>so the appropriate bit is the lsb of 0x3fc)
>(RTS)
>[baseaddr+4].1 (ie. base address of serial port, eg. com1=0x3f8,
>so the appropriate bit is the second bit of 0x3fc)
RTS or DTR are NOT TTL level signals. You will have to pass them through a
level translator (such as a 1489 or the RX half of a MAX232) to get TTL/CMOS
level outputs. From here, the signals can be used to control a relay driver
(such as a ULN2003A).
myke
"If people don't know what you're doing, they don't know what you're doing
wrong." - Sir Humphrey Appleby K.C.B
1998\03\11@061452
by
m00c0600
Craig Webb wrote:
>
> Does anyone know off-hand the memory address and value for setting the RS232
> TX line high on a PC? I need to trigger a relay connected to this line.
>
> Thanks.
>
> C. Webb
Probably better to use the DTR or RTS lines for this sort of job, as
they are direct digital outputs. Set them HI or LO by writing to the
MCR (Modem Control Register) in the PC's UART.
MCR bit 0 drives DTR
MCR bit 1 drives RTS
The address of the MCR is 03FCh, for COM1 where base-address is 03F8h,
use same offset if other port at other base address.
Hope this is of use
jim ford
1998\03\11@063202
by
maxruben
|
{Quote hidden}> >Does anyone know off-hand the memory address and value for setting the RS232
> >TX line high on a PC? I need to trigger a relay connected to this line.
> >
> >Thanks.
> >
> >C. Webb
>
> Hi,
> First of all, what do you mean HIGH on TX line on RS232 port of PC ?
> The TX and RX lines (in RS232) are not on TTL level.
> The 'logic 1' on TX (idle state) means this line is about -12V respect
> to ground, the 'logic 0' on TX (mark state) means this line is about +12V
> respect to ground.
> Apart from this, you can't change the state of TX in this way (to control
> relay).
> Instead of TX, use the RTS or DTR signal.
> These signals are TTLs, and it is easy to use as general purpose bits.
> To change these signals, set or clear the appropriate bit:
> (DTR)
> [baseaddr+4].0 (ie. base address of serial port, eg. com1=0x3f8,
> so the appropriate bit is the lsb of 0x3fc)
> (RTS)
> [baseaddr+4].1 (ie. base address of serial port, eg. com1=0x3f8,
> so the appropriate bit is the second bit of 0x3fc)
>
> bye
> csaba
>
The baseaddress can be found in the ROM BIOS parameter area at
addresses:
0000:0400 COM1
0000:0402 COM2
0000:0404 COM3
0000:0406 COM4
0000:0408 LPT1
0000:040A LPT2
0000:040C LPT3
0000:040E LPT4
The ones that doesn't exist have 0 as baseaddress.
--------------------------------
Ruben Jvnsson
spam_OUTmaxrubenTakeThisOuT
mail.bip.net
--------------------------------
1998\03\11@064404
by
Frank A. Vorstenbosch
|
Ruben Jvnsson wrote:
>
> > >Does anyone know off-hand the memory address and value for setting the
RS232
{Quote hidden}> > >TX line high on a PC? I need to trigger a relay connected to this line.
> The baseaddress can be found in the ROM BIOS parameter area at
> addresses:
>
> 0000:0400 COM1
> 0000:0402 COM2
> 0000:0404 COM3
> 0000:0406 COM4
> 0000:0408 LPT1
> 0000:040A LPT2
> 0000:040C LPT3
> 0000:040E LPT4
>
> The ones that doesn't exist have 0 as baseaddress.
But beware! Ports that are 'virtualized' under NetWare DOS clients have
"NW"
as their address value. This is done so that programs that test just
for
presence of the port by looking for zeros find a port there (and writing
to
the port by means of the BIOS then will work because the NW client traps
that). Because no parallel/serial port is present at that address,
you'd
better check for 0 as well as "NW" (0x4e57 or was it 0x574e?) there.
Frank
------------------------------------------------------------------------
Frank A. Vorstenbosch <UCE_ACCEPT="NONE"> Phone: 0181 - 636 3000
Electronics and Software Engineer Mobile: 0976 - 430 569
Eidos Technologies Ltd., Wimbledon, London Email: .....favKILLspam
@spam@eidos.co.uk
1998\03\11@171538
by
B‡rdos Csaba
Hi Mike,
You are absolutely right, of course these are not TTL,
I'm confused little bit. :(
Thanks
Csaba
>RTS or DTR are NOT TTL level signals. You will have to pass them through a
>level translator (such as a 1489 or the RX half of a MAX232) to get TTL/CMOS
>level outputs. From here, the signals can be used to control a relay driver
>(such as a ULN2003A).
>
>myke
1998\03\11@171552
by
Craig Webb
|
Thanks for the feedback everyone. I apologize for not making myself clearer.
I don't know the why behind it, but whoever designed the system I'm working
with said I have to set the TX bit high. I asked the same question about
voltages and inverted signal, etc. at the RS-232 end, but the engineer told
me all that has to be done is to hold the PC port bit high (I guess on the
UART before the MAX232 or whatever it is). So unfortunately DTR & RTS bits
won't help, but thanks for the suggestion.
If there is no direct memory mapped address to the TX bit, perhaps I have to
send a continual stream of bytes=0FFh? Any ideas?
Craig
{Quote hidden}>>Does anyone know off-hand the memory address and value for setting the RS232
>>TX line high on a PC? I need to trigger a relay connected to this line.
>First of all, what do you mean HIGH on TX line on RS232 port of PC ?
>The TX and RX lines (in RS232) are not on TTL level.
>The 'logic 1' on TX (idle state) means this line is about -12V respect
>to ground, the 'logic 0' on TX (mark state) means this line is about +12V
>respect to ground.
>Apart from this, you can't change the state of TX in this way (to control
>relay).
>Instead of TX, use the RTS or DTR signal.
>These signals are TTLs, and it is easy to use as general purpose bits.
>To change these signals, set or clear the appropriate bit:
>(DTR)
>[baseaddr+4].0 (ie. base address of serial port, eg. com1=0x3f8,
>so the appropriate bit is the lsb of 0x3fc)
>(RTS)
>[baseaddr+4].1 (ie. base address of serial port, eg. com1=0x3f8,
>so the appropriate bit is the second bit of 0x3fc)
1998\03\11@192958
by
Sean Breheny
At 03:39 PM 3/11/98 -0500, you wrote:
>Thanks for the feedback everyone. I apologize for not making myself clearer.
>I don't know the why behind it, but whoever designed the system I'm working
>with said I have to set the TX bit high. I asked the same question about
>voltages and inverted signal, etc. at the RS-232 end, but the engineer told
>me all that has to be done is to hold the PC port bit high (I guess on the
>UART before the MAX232 or whatever it is). So unfortunately DTR & RTS bits
>won't help, but thanks for the suggestion.
>
>If there is no direct memory mapped address to the TX bit, perhaps I have to
>send a continual stream of bytes=0FFh? Any ideas?
>
>Craig
Sorry, Craig, but sending continuous 0xFF won't do the trick because either
the start bit or the stop bit (I can't remember which) is a low value, to
distinguish it from the other one, which is a high value.
Sean
+--------------------------------+
| Sean Breheny |
| Amateur Radio Callsign: KA3YXM |
| Electrical Engineering Student |
+--------------------------------+
Fight injustice, please look at
http://homepages.enterprise.net/toolan/joanandrews/
Personal page: http://www.people.cornell.edu/pages/shb7
shb7
KILLspamcornell.edu
Phone(USA): (607) 253-0315
1998\03\11@193004
by
myke predko
|
Hi Craig,
>Thanks for the feedback everyone. I apologize for not making myself clearer.
>I don't know the why behind it, but whoever designed the system I'm working
>with said I have to set the TX bit high. I asked the same question about
>voltages and inverted signal, etc. at the RS-232 end, but the engineer told
>me all that has to be done is to hold the PC port bit high (I guess on the
>UART before the MAX232 or whatever it is). So unfortunately DTR & RTS bits
>won't help, but thanks for the suggestion.
>
>If there is no direct memory mapped address to the TX bit, perhaps I have to
>send a continual stream of bytes=0FFh? Any ideas?
Sending a continous stream of 0x0FF will just send a +12V "blip" on the line.
If you want to output a continuous +12V from the RS-232 port, set bit 6 of
the "Line Control Register" (Base Register + 3), which is the "Set Break"
bit. By setting this bit, you will, for all intents and purposes disable
the serial port's transmitter and just send a "Space" (or +12V).
I *think* this is what the engineer is trying to tell you, but if this
doesn't work, maybe he should go back to RS-232 school.
myke
{Quote hidden}>Craig
>
>>>Does anyone know off-hand the memory address and value for setting the RS232
>>>TX line high on a PC? I need to trigger a relay connected to this line.
>
>>First of all, what do you mean HIGH on TX line on RS232 port of PC ?
>>The TX and RX lines (in RS232) are not on TTL level.
>>The 'logic 1' on TX (idle state) means this line is about -12V respect
>>to ground, the 'logic 0' on TX (mark state) means this line is about +12V
>>respect to ground.
>>Apart from this, you can't change the state of TX in this way (to control
>>relay).
>>Instead of TX, use the RTS or DTR signal.
>>These signals are TTLs, and it is easy to use as general purpose bits.
>>To change these signals, set or clear the appropriate bit:
>>(DTR)
>>[baseaddr+4].0 (ie. base address of serial port, eg. com1=0x3f8,
>>so the appropriate bit is the lsb of 0x3fc)
>>(RTS)
>>[baseaddr+4].1 (ie. base address of serial port, eg. com1=0x3f8,
>>so the appropriate bit is the second bit of 0x3fc)
>
>
"If people don't know what you're doing, they don't know what you're doing
wrong." - Sir Humphrey Appleby K.C.B
1998\03\11@201139
by
Mike Keitz
On Wed, 11 Mar 1998 15:39:00 -0500 Craig Webb <.....lucidKILLspam
.....MAGNET.CA> writes:
>If there is no direct memory mapped address to the TX bit, perhaps I
>have to
>send a continual stream of bytes=0FFh? Any ideas?
There is a "set break" bit which, when set, disables the normal
transmitter logic and forces the TX line "high" (positive RS-232
voltage). I don't have the book here but I think it's in the same
register that controls the number of bits per character, parity, etc.
Maybe 3FB, bit 7 but this is strictly a guess.
Sending 00 repeatedly would hold the TX line positive for 10/11 of the
time, however the stop bits would still make it negative periodically.
_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]
1998\03\12@090303
by
Frank Mckenney
|
>
> Does anyone know off-hand the memory address and value for setting the RS232
> TX line high on a PC? I need to trigger a relay connected to this line.
>
> Thanks.
>
> C. Webb
Craig,
As other posters have pointed out, the serial ports on an Intel-PC
are built for sending and receiving "formatted" async bitstreams on
the TX and RX lines. As far as I know, there's no way of directly
bit-banging the TX and RX lines, which is what it sounds like you're
trying to do.
Why not use the modem control lines (RTS,DTR), as other posters have
suggested, and simply re-wire the cable to look at one of _those_
lines? Or, since some cables aren't easy to re-wire, pick up an
under-$10 "breakout" box from RadioShack(TechAmerica) and wire it
to cross (say) DTR on the Intel PC side to the cable's TX line?
Then just plugh teh adapter box into the circuit...
There may be reasons why this won't work ("It's an imperfect
universe" (;-); even so, if we can learn those reasons, it might
help define a better answer to your problem.
Hope this helps...
Frank McKenney / OS/2 Advisor (OS2BBS)
McKenney Associates / Richmond, Virginia / (804) 320-4887
Internet: EraseMErrs0059spam_OUT
TakeThisOuTibm.net / TalkLink: WZ01123
1998\03\13@092233
by
kevindod
You can "bit-bang: other pins like dtr, rts etc. and with the use of 2
connectors make it look like the rx/tx lines. Alternately wire your
circuitry to these alternate pins. Be warned that you need to provide
external power to your curcuit since some ports a low power(2-4 ma).
Kevin E. Dodd
Embedded Systems Consulting
kevindod
spam_OUTtriax.com
503.684-3731 Reached at
541.753-3633
{Original Message removed}
1998\03\13@172737
by
Alex Torres
> Does anyone know off-hand the memory address and value for setting the
RS232
> TX line high on a PC? I need to trigger a relay connected to this line.
>
> Thanks.
>
> C. Webb
All RS232 chip have BREAK condition. But what about using DTR signal
against TX ?
Alex Torres, Kharkov, Ukraine (exUSSR)
@spam@altorKILLspam
chat.ru
2:461/28@FidoNet
www.geocities.com/SiliconValley/Lab/6311
1998\03\13@235752
by
paulb
|
Frank A. Vorstenbosch wrote:
> But beware! Ports that are 'virtualized' under NetWare DOS clients
> have "NW" as their address value. This is done so that programs that
> test just for presence of the port by looking for zeros find a port
> there (and writing to the port by means of the BIOS then will work
> because the NW client traps that).
An interesting detail which I will spirit away. Not terribly
practical though. Prior to Windoze, no usable BIOS *existed* for the
COM ports and therefore all comms programs contained their own COM port
drivers, or used generic ones in which case NetWare *may* have provided
network-compliant versions of some popular generic drivers.
Windoze contains comms drivers, but if you try to access COM ports
directly, it gets a bit upset, particularly if it determines a program
(and that includes the O/S itself, and notably the mouse driver) is
already using that port.
In summary, those that *knew* pointed out that you can "bit-bang" the
TX Data line quite effectively using the "Set Break" bit, though I
wouldn't guarantee accurate timing. Bit-banging the RTS and DTR lines
is also very easy and routinely used to implement synchronous protocols,
receiving data on the CTS, DTR and CD lines in the same fashion. This
can even be done while the TXD is in use for normal, separate serial
data (just as LapLink does!). *All* these lines are RS-232 (insofar as
the machine provides) at the connector.
OTOH, most relays would not respond to the sub-millisecond
interruptions of a continuous stream of $FF characters sent at 1200
baud and above anyway. Indeed, capacitive coupling and a rectifier
would make a very good "fail-safe" system with such a signal source.
Cheers,
Paul B.
1998\03\19@194210
by
Craig Webb
Thanks to all who provided assistance. Problem solved, it was indeed a
"break" signal (base address + 3, bit 6) that I needed to send to toggle the
switch.
Craig Webb
At 12:31 PM 3/11/98 +0000, you wrote:
>> >Does anyone know off-hand the memory address and value for setting the RS232
>> >TX line high on a PC? I need to trigger a relay connected to this line.
More... (looser matching)
- Last day of these posts
- In 1998
, 1999 only
- Today
- New search...