Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
serial port DTR and RTS

Subject: serial port DTR and RTS

From: Vihang Patil

Date: 25 Mar, 2008 17:12:01

Message: 1 of 8

Hello
I am trying to develop a circuit that can drive 2 relay's
using RS232's DTR pin( Data Terminal Ready) and RTS
(Request To Send).
Before I open the serial port, I check the potential on
these both pins and I see that they are aroung -11.20 V
Now I open the serial port using

s1 = serial('COM1');
and use

s1.RequestToSend = 'on'
and
s1.DataTerminalReady = 'on'

But I dont see any potential across thse 2 pins? They are
still at -11.20 V. Changing the string from 'on' to 'off'
also has no effect.
P.N: I have only 1 COM port on my pc.
Am I missing here something? Please advice
Regards
Vihang

Subject: serial port DTR and RTS

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 25 Mar, 2008 17:37:55

Message: 2 of 8

In article <fsbbp1$luf$1@fred.mathworks.com>,
Vihang Patil <vihang_patil@yahoo.com> wrote:
>I am trying to develop a circuit that can drive 2 relay's
>using RS232's DTR pin( Data Terminal Ready) and RTS
>(Request To Send).
>Before I open the serial port, I check the potential on
>these both pins and I see that they are aroung -11.20 V
>Now I open the serial port using

>s1 = serial('COM1');
>and use

>s1.RequestToSend = 'on'
>and
>s1.DataTerminalReady = 'on'

>But I dont see any potential across thse 2 pins? They are
>still at -11.20 V. Changing the string from 'on' to 'off'
>also has no effect.

I am not familiar with the instrument control toolbox, but I have
seen on other systems that sometimes control settings such as DTR
do not take effect until you "open" the serial connection.
--
  "Allegories are in the realm of thoughts, what ruins are in
  the realm of things." -- Walter Benjamin

Subject: serial port DTR and RTS

From: Trent Jarvi

Date: 25 Mar, 2008 18:15:30

Message: 3 of 8


"Walter Roberson" <roberson@ibd.nrc-cnrc.gc.ca> wrote in message
news:fsbd9j$ggb$1@canopus.cc.umanitoba.ca...
> In article <fsbbp1$luf$1@fred.mathworks.com>,
> Vihang Patil <vihang_patil@yahoo.com> wrote:
>>I am trying to develop a circuit that can drive 2 relay's
>>using RS232's DTR pin( Data Terminal Ready) and RTS
>>(Request To Send).
>>Before I open the serial port, I check the potential on
>>these both pins and I see that they are aroung -11.20 V
>>Now I open the serial port using
>
>>s1 = serial('COM1');
>>and use
>
>>s1.RequestToSend = 'on'
>>and
>>s1.DataTerminalReady = 'on'
>
>>But I dont see any potential across thse 2 pins? They are
>>still at -11.20 V. Changing the string from 'on' to 'off'
>>also has no effect.
>
> I am not familiar with the instrument control toolbox, but I have
> seen on other systems that sometimes control settings such as DTR
> do not take effect until you "open" the serial connection.

Correct. The serial port is not changed until FOPEN is called.

Subject: serial port DTR and RTS

From: Vihang Patil

Date: 26 Mar, 2008 06:59:02

Message: 4 of 8

"Vihang Patil" <vihang_patil@yahoo.com> wrote in message
<fsbbp1$luf$1@fred.mathworks.com>...
> Hello
> I am trying to develop a circuit that can drive 2
relay's
> using RS232's DTR pin( Data Terminal Ready) and RTS
> (Request To Send).
> Before I open the serial port, I check the potential on
> these both pins and I see that they are aroung -11.20 V
> Now I open the serial port using
>
> s1 = serial('COM1');
> and use
>
> s1.RequestToSend = 'on'
> and
> s1.DataTerminalReady = 'on'
>
> But I dont see any potential across thse 2 pins? They
are
> still at -11.20 V. Changing the string from 'on'
to 'off'
> also has no effect.
> P.N: I have only 1 COM port on my pc.
> Am I missing here something? Please advice
> Regards
> Vihang

Thanks Walter fopen(s1) solved that problem. But then, I
have one problem not directly related to Matlab, but if
anyone had come across similar problem could probably post
here.
My main purpose to access the DTR and RTS pins is to drive
2 relays. And as walter suggested, fopen(s1) makes the
potential across DTR pin logic 1 i.e +12V and then
s1.RequestToSend = 'on' makes RTS pin logic 1 i.e. +12V
with which I can drive a relay.
But now, the probem arises("Not a Matlab Part from here"),
when I turn off the computer and restart it again.
I see while during the booting process Windows probably
sends some initialization commands which turn on and off
these DTR and RTS pins, and because of which my relays
turn on and off without my consent. Have anyone faced
similar problems. I would like to know a workaround, if
any, so that I can disable this check in the booting
process.

Same thing I have also noticed on the parallel port.

Regards
Vihang

Subject: serial port DTR and RTS

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 26 Mar, 2008 18:07:27

Message: 5 of 8

In article <fscs7m$73d$1@fred.mathworks.com>,
Vihang Patil <vihang_patil@yahoo.com> wrote:

>My main purpose to access the DTR and RTS pins is to drive
>2 relays. And as walter suggested, fopen(s1) makes the
>potential across DTR pin logic 1 i.e +12V and then
>s1.RequestToSend = 'on' makes RTS pin logic 1 i.e. +12V
>with which I can drive a relay.

>But now, the probem arises("Not a Matlab Part from here"),
>when I turn off the computer and restart it again.
>I see while during the booting process Windows probably
>sends some initialization commands which turn on and off
>these DTR and RTS pins, and because of which my relays
>turn on and off without my consent. Have anyone faced
>similar problems. I would like to know a workaround, if
>any, so that I can disable this check in the booting
>process.

I have heard of that effect before.

I do very little hardware work, but I've heard of that problem
being solved in at least two ways:

a) putting in a high-frequency filter that filters out the
brief off-on-off pulse at boot time;

b) putting in a capacitor so that the relay is not activated until
the line has been high enough for long enough to discharge the
capacitor. Potentially you might need to "bleed" the capacitor slowly
so that enough reboots in a row do not together add up to the
threshhold.

I probably do not have the details quite right about how you would
get a threshhold trigger; it's been 30-ish years since I played
at that level.
--
  "You may comand nature to the extent only in which you are willing to
  obey her." -- Walter Russell

Subject: serial port DTR and RTS

From: Vihang Patil

Date: 26 Mar, 2008 18:34:02

Message: 6 of 8

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <fse3cv$k8k$1@canopus.cc.umanitoba.ca>...
> In article <fscs7m$73d$1@fred.mathworks.com>,
> Vihang Patil <vihang_patil@yahoo.com> wrote:
>
> >My main purpose to access the DTR and RTS pins is to drive
> >2 relays. And as walter suggested, fopen(s1) makes the
> >potential across DTR pin logic 1 i.e +12V and then
> >s1.RequestToSend = 'on' makes RTS pin logic 1 i.e. +12V
> >with which I can drive a relay.
>
> >But now, the probem arises("Not a Matlab Part from here"),
> >when I turn off the computer and restart it again.
> >I see while during the booting process Windows probably
> >sends some initialization commands which turn on and off
> >these DTR and RTS pins, and because of which my relays
> >turn on and off without my consent. Have anyone faced
> >similar problems. I would like to know a workaround, if
> >any, so that I can disable this check in the booting
> >process.
>
> I have heard of that effect before.
>
> I do very little hardware work, but I've heard of that problem
> being solved in at least two ways:
>
> a) putting in a high-frequency filter that filters out the
> brief off-on-off pulse at boot time;
>
> b) putting in a capacitor so that the relay is not
activated until
> the line has been high enough for long enough to discharge the
> capacitor. Potentially you might need to "bleed" the
capacitor slowly
> so that enough reboots in a row do not together add up to the
> threshhold.
>
> I probably do not have the details quite right about how
you would
> get a threshhold trigger; it's been 30-ish years since I
played
> at that level.
> --
> "You may comand nature to the extent only in which you
are willing to
> obey her." -- Walter
Russell


I did a bit of googling and found out how I could turn off
the parallel port pins from getting high on windows boot.
Well, you have to access the registry, "regedit" and then
modify the
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Parport"
and then modify the "Start" to have value 4.
This solved my problem of parallel port getting initialised
on windows startup. I am still working on how I could
achieve the same on serial device(RS232 port) too..
Regards
Vihang

Subject: serial port DTR and RTS

From: Thomas Lutz

Date: 27 Mar, 2008 14:50:20

Message: 7 of 8

When Windows boots, it looks for a mouse connected to the serial ports
on the PC. This is probably what is causing the RTS and DTR lines to
be asserted when your PC boots. You can disable this functionality by
setting a flag in your Boot.INI file.
The following articles discuss how to do this:

http://support.microsoft.com/kb/q131976/
http://support.microsoft.com/kb/283063/en-us





On Wed, 26 Mar 2008 06:59:02 +0000 (UTC), "Vihang Patil"
<vihang_patil@yahoo.com> wrote:

>"Vihang Patil" <vihang_patil@yahoo.com> wrote in message
><fsbbp1$luf$1@fred.mathworks.com>...
>> Hello
>> I am trying to develop a circuit that can drive 2
>relay's
>> using RS232's DTR pin( Data Terminal Ready) and RTS
>> (Request To Send).
>> Before I open the serial port, I check the potential on
>> these both pins and I see that they are aroung -11.20 V
>> Now I open the serial port using
>>
>> s1 = serial('COM1');
>> and use
>>
>> s1.RequestToSend = 'on'
>> and
>> s1.DataTerminalReady = 'on'
>>
>> But I dont see any potential across thse 2 pins? They
>are
>> still at -11.20 V. Changing the string from 'on'
>to 'off'
>> also has no effect.
>> P.N: I have only 1 COM port on my pc.
>> Am I missing here something? Please advice
>> Regards
>> Vihang
>
>Thanks Walter fopen(s1) solved that problem. But then, I
>have one problem not directly related to Matlab, but if
>anyone had come across similar problem could probably post
>here.
>My main purpose to access the DTR and RTS pins is to drive
>2 relays. And as walter suggested, fopen(s1) makes the
>potential across DTR pin logic 1 i.e +12V and then
>s1.RequestToSend = 'on' makes RTS pin logic 1 i.e. +12V
>with which I can drive a relay.
>But now, the probem arises("Not a Matlab Part from here"),
>when I turn off the computer and restart it again.
>I see while during the booting process Windows probably
>sends some initialization commands which turn on and off
>these DTR and RTS pins, and because of which my relays
>turn on and off without my consent. Have anyone faced
>similar problems. I would like to know a workaround, if
>any, so that I can disable this check in the booting
>process.
>
>Same thing I have also noticed on the parallel port.
>
>Regards
>Vihang

Subject: serial port DTR and RTS

From: Vihang Patil

Date: 28 Mar, 2008 07:57:02

Message: 8 of 8

Thomas Lutz <tom@taltech.com> wrote in message
<ptcnu35qcareaatfe6lh8ib07noinjqbjh@4ax.com>...
> When Windows boots, it looks for a mouse connected to
the serial ports
> on the PC. This is probably what is causing the RTS and
DTR lines to
> be asserted when your PC boots. You can disable this
functionality by
> setting a flag in your Boot.INI file.
> The following articles discuss how to do this:
>
> http://support.microsoft.com/kb/q131976/
> http://support.microsoft.com/kb/283063/en-us
>

Thanks Thomas for your suggestions. I had gone through
these articls before too but then these were either for NT
of Windows 2000. For XP I had read a articles which
suggested to use /fastdetect to disable serial and
parallel port enumeration. But that option really does not
make any difference at all. If you have XP the default
settings in the Boot.ini is /fastdetect. But that did not
solve my problem.
I got a workaround for disabling parallel port on windows
startup which is posted above some where in this thread.
But havent so far got a solution to disable the serial
device.
Vihang

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us