write ser problem

bridged with qdn.public.devtools
Post Reply
John Zou

write ser problem

Post by John Zou » Tue Dec 02, 2003 3:09 pm

hi all,

I want to execute the write() function continuously to write data to a ser
port. But I find that every time the write runs about 40 times (40 bytes
each time), there is a pause for about 6 seconds. I don't know why there is
such a break in the write() loop. Can you tell me how to make the write
operation smooth? Is there any termios configuration issue?

Thanks!

John

David Gibbs

Re: write ser problem

Post by David Gibbs » Tue Dec 02, 2003 8:56 pm

John Zou <yjzou@sina.com> wrote:
hi all,

I want to execute the write() function continuously to write data to a ser
port. But I find that every time the write runs about 40 times (40 bytes
each time), there is a pause for about 6 seconds. I don't know why there is
such a break in the write() loop. Can you tell me how to make the write
operation smooth? Is there any termios configuration issue?
What is the baud rate of your serial port? What serial port driver
are you running? What command-line option, if any, have you supplied
to it?

Without further evidence, it sounds like you're running at about
2400 baud, and you fill up the output queue, then block while it
drains, fill it up again, then block again... etc.

-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

John Zou

Re: write ser problem

Post by John Zou » Wed Dec 03, 2003 12:56 am

The baud is 57600bps. I can set the baud in the source. The driver I use is
devc-ser8250. the command line is as below:
# devc-ser8250 -u3 2458h

How can I set the size of the ser port? Is there anything I can do to make
the transmission more smooth?

"David Gibbs" <dagibbs@qnx.com> дÈëÏûÏ¢ÐÂÎÅ:bqiu9s$3n5$1@nntp.qnx.com...
John Zou <yjzou@sina.com> wrote:
hi all,

I want to execute the write() function continuously to write data to a
ser
port. But I find that every time the write runs about 40 times (40 bytes
each time), there is a pause for about 6 seconds. I don't know why there
is
such a break in the write() loop. Can you tell me how to make the write
operation smooth? Is there any termios configuration issue?

What is the baud rate of your serial port? What serial port driver
are you running? What command-line option, if any, have you supplied
to it?

Without further evidence, it sounds like you're running at about
2400 baud, and you fill up the output queue, then block while it
drains, fill it up again, then block again... etc.

-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

David Gibbs

Re: write ser problem

Post by David Gibbs » Wed Dec 03, 2003 3:04 pm

John Zou <yjzou@sina.com> wrote:
The baud is 57600bps. I can set the baud in the source. The driver I use is
devc-ser8250. the command line is as below:
# devc-ser8250 -u3 2458h
Well, my guess was wrong, so I have no idea what is happening.

-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Mario Charest

Re: write ser problem

Post by Mario Charest » Wed Dec 03, 2003 3:23 pm

"John Zou" <yjzou@sina.com> wrote in message
news:bqjb7b$rt3$1@inn.qnx.com...
The baud is 57600bps. I can set the baud in the source. The driver I use
is
devc-ser8250. the command line is as below:
# devc-ser8250 -u3 2458h

How can I set the size of the ser port? Is there anything I can do to make
the transmission more smooth?
Run stty </dev/ser? to make sure baud rate is set properly.

Have you disabled the hardware flow control? If not maybe the other side is
stopping transmission.

2458h isn't standard (for PC) hence I sound strange that you are not
specifing IRQ as well?
"David Gibbs" <dagibbs@qnx.com> дÈëÏûÏ¢ÐÂÎÅ:bqiu9s$3n5$1@nntp.qnx.com...
John Zou <yjzou@sina.com> wrote:
hi all,

I want to execute the write() function continuously to write data to a
ser
port. But I find that every time the write runs about 40 times (40
bytes
each time), there is a pause for about 6 seconds. I don't know why
there
is
such a break in the write() loop. Can you tell me how to make the
write
operation smooth? Is there any termios configuration issue?

What is the baud rate of your serial port? What serial port driver
are you running? What command-line option, if any, have you supplied
to it?

Without further evidence, it sounds like you're running at about
2400 baud, and you fill up the output queue, then block while it
drains, fill it up again, then block again... etc.

-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

John Zou

Re: write ser problem

Post by John Zou » Mon Dec 08, 2003 10:25 am

I find that if I add a tcdrain() right after the write(),
the sending is smooth. I think this is to force to send all the content to
the port physically.

Can you explain this phenomenon?

"Mario Charest" <postmaster@127.0.0.1> дÈëÏûÏ¢ÐÂÎÅ
:bqku0e$2vg$1@inn.qnx.com...
"John Zou" <yjzou@sina.com> wrote in message
news:bqjb7b$rt3$1@inn.qnx.com...
The baud is 57600bps. I can set the baud in the source. The driver I use
is
devc-ser8250. the command line is as below:
# devc-ser8250 -u3 2458h

How can I set the size of the ser port? Is there anything I can do to
make
the transmission more smooth?

Run stty </dev/ser? to make sure baud rate is set properly.

Have you disabled the hardware flow control? If not maybe the other side
is
stopping transmission.

2458h isn't standard (for PC) hence I sound strange that you are not
specifing IRQ as well?


"David Gibbs" <dagibbs@qnx.com> дÈëÏûÏ¢ÐÂÎÅ
:bqiu9s$3n5$1@nntp.qnx.com...
John Zou <yjzou@sina.com> wrote:
hi all,

I want to execute the write() function continuously to write data to
a
ser
port. But I find that every time the write runs about 40 times (40
bytes
each time), there is a pause for about 6 seconds. I don't know why
there
is
such a break in the write() loop. Can you tell me how to make the
write
operation smooth? Is there any termios configuration issue?

What is the baud rate of your serial port? What serial port driver
are you running? What command-line option, if any, have you supplied
to it?

Without further evidence, it sounds like you're running at about
2400 baud, and you fill up the output queue, then block while it
drains, fill it up again, then block again... etc.

-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.



Mario Charest

Re: write ser problem

Post by Mario Charest » Tue Dec 09, 2003 4:56 am

"John Zou" <yjzou@sina.com> wrote in message
news:br1ibf$pav$1@inn.qnx.com...
I find that if I add a tcdrain() right after the write(),
the sending is smooth. I think this is to force to send all the content to
the port physically.

Can you explain this phenomenon?
No. I beleive there is some information missing in your description and am
unable to imagine what it is.

"Mario Charest" <postmaster@127.0.0.1> дÈëÏûÏ¢ÐÂÎÅ
:bqku0e$2vg$1@inn.qnx.com...

"John Zou" <yjzou@sina.com> wrote in message
news:bqjb7b$rt3$1@inn.qnx.com...
The baud is 57600bps. I can set the baud in the source. The driver I
use
is
devc-ser8250. the command line is as below:
# devc-ser8250 -u3 2458h

How can I set the size of the ser port? Is there anything I can do to
make
the transmission more smooth?

Run stty </dev/ser? to make sure baud rate is set properly.

Have you disabled the hardware flow control? If not maybe the other
side
is
stopping transmission.

2458h isn't standard (for PC) hence I sound strange that you are not
specifing IRQ as well?


"David Gibbs" <dagibbs@qnx.com> дÈëÏûÏ¢ÐÂÎÅ
:bqiu9s$3n5$1@nntp.qnx.com...
John Zou <yjzou@sina.com> wrote:
hi all,

I want to execute the write() function continuously to write data
to
a
ser
port. But I find that every time the write runs about 40 times (40
bytes
each time), there is a pause for about 6 seconds. I don't know why
there
is
such a break in the write() loop. Can you tell me how to make the
write
operation smooth? Is there any termios configuration issue?

What is the baud rate of your serial port? What serial port driver
are you running? What command-line option, if any, have you
supplied
to it?

Without further evidence, it sounds like you're running at about
2400 baud, and you fill up the output queue, then block while it
drains, fill it up again, then block again... etc.

-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.





Post Reply

Return to “qdn.public.devtools”