Searching \ for '[PIC]RS-232 on the pc side' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=rs%2D232
Search entire site for: 'RS-232 on the pc side'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]RS-232 on the pc side'
2006\10\20@175157 by Genome

picon face
Hello..
when Does the DTR pin(data terminal ready) of the RS-232 on the PC turns
on.. and if it turns on is it like a single pulse and then turns off again
or is it always on while the USART has connection... I am planning to use it
to detect if the PC DB9 plug is connected to the PIC and if so try to
initiate a handshake.. I dont know exactly but I've read somewhere that the
DTR pin is controlled by specific drivers of the communication PORT
installed on windows... My question is only for the standard CommPort
Driver... hope someone point me where I can read more about this stuff..
theres not much information on microsoft MSDN website except for win32
programming of the serial port but other than that not much details...

thanks..



2006\10\20@181513 by Orin Eman

picon face
On 10/19/06, Genome <spam_OUTjtroxasTakeThisOuTspamgmail.com> wrote:
> Hello..
> when Does the DTR pin(data terminal ready) of the RS-232 on the PC turns
> on.. and if it turns on is it like a single pulse and then turns off again
> or is it always on while the USART has connection... I am planning to use it
> to detect if the PC DB9 plug is connected to the PIC and if so try to
> initiate a handshake.. I dont know exactly but I've read somewhere that the
> DTR pin is controlled by specific drivers of the communication PORT
> installed on windows... My question is only for the standard CommPort
> Driver... hope someone point me where I can read more about this stuff..
> theres not much information on microsoft MSDN website except for win32
> programming of the serial port but other than that not much details...
>
> thanks..

It depends on the PC software.  Usually, it will be turned on when the
port is opened and left on until the port is closed.  But if the
software thinks it's talking to a modem, it may not turn it on until
it's ready to dial or wait for a call and may turn it off in order to
hangup the modem.

Orin.

2006\10\20@182406 by Andre Abelian

flavicon
face
Keep sending data suppose 0x55,0x01 and wait for response.
The response is suppose 0x55,0x10. Every time you send data
first send communication byte if no response then no more
data. Using RX and TX you can do all.

Andre



{Original Message removed}

2006\10\20@193128 by Genome

picon face
> Keep sending data suppose 0x55,0x01 and wait for response.

My problem with the keep sending data is that there is no way of telling
when the pic is suddenly disconnected in the middle of a communication..
i.e. the pic will just think that there are errors and no way of telling
whether the error is due to cable disconnection or just transmission
errors... I would like something like plugAndplay capability...

thanks...

"Andre Abelian" <.....aabelianKILLspamspam@spam@mason-electric.com> wrote in message
news:4AFCCF9D5E7797409D14588363C2395160303DspamKILLspamrobin.mason...> > Keep sending data suppose 0x55,0x01 and wait for response.
> The response is suppose 0x55,0x10. Every time you send data
> first send communication byte if no response then no more
> data. Using RX and TX you can do all.
>
> Andre
>
>
>
> {Original Message removed}

2006\10\20@195207 by Genome

picon face
Is there some function in the win32 sdk that can tell a standard comm driver
that I'm not connected to a modem...

I'm using simple createfile functions to open and close the port and
read/writefile functions to send/receive data to the pic... I found the
EscapeCommFunction that can directly acces the dtr and rts pins but dont
know how it will effect the port drivers operation as it automatically set
and unset this pins when you try to send and receive data...

thanks...

"Orin Eman" <.....orin.emanKILLspamspam.....gmail.com> wrote in message
news:EraseME25b306ec0610201514m4e4731c8n3ad2da7365b667daspam_OUTspamTakeThisOuTmail.gmail.com...> {Quote hidden}

> --

2006\10\20@200705 by Orin Eman

picon face
On 10/19/06, Genome <@spam@jtroxasKILLspamspamgmail.com> wrote:
> Is there some function in the win32 sdk that can tell a standard comm driver
> that I'm not connected to a modem...
>
> I'm using simple createfile functions to open and close the port and
> read/writefile functions to send/receive data to the pic... I found the
> EscapeCommFunction that can directly acces the dtr and rts pins but dont
> know how it will effect the port drivers operation as it automatically set
> and unset this pins when you try to send and receive data...

You need to look at the DCB field in the COMMCONFIG structure.  See
GetCommConfig() and SetCommConfig().  You should be able to have DTR
behave anyway you want!

Orin.

2006\10\22@174040 by Gerhard Fiedler

picon face
Genome wrote:

>> Keep sending data suppose 0x55,0x01 and wait for response.
>
> My problem with the keep sending data is that there is no way of telling
> when the pic is suddenly disconnected in the middle of a communication..
> i.e. the pic will just think that there are errors and no way of telling
> whether the error is due to cable disconnection or just transmission
> errors... I would like something like plugAndplay capability...

Not even with DTR or any other signal you will be able to tell whether the
error is due to cable disconnection or transmission error (say a broken
cable or a pin with bad contact).

Usually there is a problem that you should solve anyway when you have a
significant number of transmission errors (as in scrambled bits) in a wired
short-range serial link.

Even though you can, you probably shouldn't have to deal with additional
status lines. Sending out a "start of transmission" marker and waiting a
short time seems good enough to me, too.

You also didn't say on what side you want to detect the presence of a
connected device. If you want to know at the PC side whether there's
something connected at the serial port, the PC's DTR output doesn't seem to
be the one you need -- an input (CTS, DSR, CT) would probably be better
suited.

Gerhard

2006\10\22@181024 by Genome

picon face
I'm thingking of setting DTR on from the PC side when connecting and then
the device on the other end should reply by setting DSR on.. and keep them
on while connected. just like a modem.. to detect a connection and sudden
disconnection.. im thinking of always querying this pins before sending and
receiving couple it with some error handling routine to tell if the cable is
good or not.

thanks everyone for all your inputs..

{Original Message removed}

2006\10\22@191319 by Jan-Erik Söderholm

face picon face
Hi.

I'm not sure if it have been mentioned, but I would
look for a software instead of a hardware solution
becuse of the extra PIC I/O pin(s) "wasted"...

Like some special character sequesnce to "open the line",
and always expect echo's to detect "line down".

Jan-Erik.



Genome skrev:
> I'm thingking of setting DTR on from the PC side when connecting and then
> the device on the other end should reply by setting DSR on.. and keep them
> on while connected. just like a modem.. to detect a connection and sudden
> disconnection.. im thinking of always querying this pins before sending and
> receiving couple it with some error handling routine to tell if the cable is
> good or not.
>
> thanks everyone for all your inputs..
>
> {Original Message removed}

2006\10\22@191923 by Orin Eman

picon face
On 10/21/06, Genome <KILLspamjtroxasKILLspamspamgmail.com> wrote:
> I'm thingking of setting DTR on from the PC side when connecting and then
> the device on the other end should reply by setting DSR on.. and keep them
> on while connected. just like a modem.. to detect a connection and sudden
> disconnection.. im thinking of always querying this pins before sending and
> receiving couple it with some error handling routine to tell if the cable is
> good or not.

Pretty much using the pins for their intended purpose.  Sounds good to me!

Orin.

2006\10\23@094559 by Gerhard Fiedler

picon face
Orin Eman wrote:

> On 10/21/06, Genome <RemoveMEjtroxasTakeThisOuTspamgmail.com> wrote:
>> I'm thingking of setting DTR on from the PC side when connecting and
>> then the device on the other end should reply by setting DSR on.. and
>> keep them on while connected. just like a modem.. to detect a
>> connection and sudden disconnection.. im thinking of always querying
>> this pins before sending and receiving couple it with some error
>> handling routine to tell if the cable is good or not.
>
> Pretty much using the pins for their intended purpose.  Sounds good to
> me!

Except that it wastes two pins, as Jan-Erik says, without any benefit -- at
least not one that I could spot.

You probably need some kind of packet/error detection structure anyway. So
sending out a start marker (or a whole packet; depending on the length of
the packets) and waiting a short time for the correct response seems good
enough. If the response doesn't come, you just assume that there's no
device connected and repeat the check. When there's a correct response, you
assume a device connected. On the device side, you don't respond unless you
receive a complete and correct start marker (or packet, see above).

I can't imagine what the pins would detect that this doesn't. You can hook
up an interrupt to the pins and detect the (relative) exact moment when the
device gets removed from the serial port, but is this important? Or is it
good enough that you know whether a start marker or packet gets responded
to correctly (indicating the presence or not of the device)?

BTW, the modem analogy is not quite correct. The status pins in the
communication with a modem serve their purpose because the PC (or whatever
DTE) is not actually communicating /with/ the modem (normally): it is
communicating with another device /through/ the modem. So the protocol
(whatever it is) on the TxD/RxD lines is not the modem protocol, it is the
protocol of the device on the other end of the line. The status pins help
maintaining the communication with the modem while the devices and the ends
of the line communicate with each other. Designing something like this from
scratch today, you'd probably just pack a modem control protocol on top of
something like TCP/Ethernet or USB and be done with it -- no status lines.

Gerhard

2006\10\23@110558 by alan smith

picon face
the comm software that Maxstream provides does this somehow...when I pull the serial cable it comes up with an error...cannot communicate with device...or something like that

Genome <spamBeGonejtroxasspamBeGonespamgmail.com> wrote:  Is there some function in the win32 sdk that can tell a standard comm driver
that I'm not connected to a modem...

I'm using simple createfile functions to open and close the port and
read/writefile functions to send/receive data to the pic... I found the
EscapeCommFunction that can directly acces the dtr and rts pins but dont
know how it will effect the port drivers operation as it automatically set
and unset this pins when you try to send and receive data...

thanks...

"Orin Eman" wrote in message
news:TakeThisOuT25b306ec0610201514m4e4731c8n3ad2da7365b667daEraseMEspamspam_OUTmail.gmail.com...> {Quote hidden}

> -

More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...