Re: Events on Serial port



On 4 Jul, 12:01, Rolf Schroedter <m...@xxxxxxxxxxx> wrote:
Derek wrote, On 04.07.2008 11:07:

What do you mean by full speed, at the set baud rate?
I presume the latency in the actual write from the background is OS
dependant!, this may not be the issue but would have an impact on what
I'm doing.

By "full speed" I mean that in worst case bytes are transmitted as fast
as the baud rate allows, one character after the other using the
UART-FIFO (if no handshake).
And you don't have any control, because specially Windows is far from
being a real-time OS with predictable timing.
Your OS may even decide not to send/receive characters even for seconds,
if it thinks, that there is something more important to do.

If there are real timing restrictions on the receiver side, then you
need handshake. Adding artificial delays after sending each character
may help (I'm doing this), but there is no guaranty, neither for Linux
nor for Windows.

So far an otherwise idle Linux box seems fine, there isn't a lot of
data to move around, just 27 bytes.
I need to get the data in and process it pretty quick but otherwise
I'm idle mostly.

I have quite strict timing, i need to detect and process RDS data
within 22mS worse case.
This is fine under Linux, Tcl is quite fast  at doing the processing,
getting the data into the script is the slow part!

Generally that should be possible, but this depends on your baud rate
and your serial driver settings.

Looking on the scope a buad rate of just 115200 seems to be fine, I'm
keeping to this as I can't predict the performance
of the inbuilt uarts. I assume that a modern PC will do 115200.

E.g. in the device manager/com port/Port settings/advanced there is a
slider for interrupt levels for your FIFO which radically changes your
serial I/O latency. I prefer the Low(1) settings meaning that an
interrupt is generated after reception of the first incoming character
without any delay. The Higher(14) settings are useful for very fast
serial transmissions (Modem Internet) to avoid overloading the OS with
serial interrupts.
I've looked at the buffers when I found I wasn't getting anything back
and shrunk them both down to minimum.

I'll check out the interrupt settings.

I'm not totally clear, where is your problem.
Do you suspect that sent characters are not received ?
Or do you have more trouble to detect and process incoming bytes ?
What is your baud rate and your complete [fconfigure] settings ?

Under Linux there was no problem per-se but I was wondering if there
was a better way of doing what I'm doing.
Some event driven method rather than polling.

Since starting this thread I found that Windows does not want to play
ball.

I know that the script side of things can handle detecting and
processing the data.
I know that the H/W can deliver the data at the rate required, it all
works under Linux
However it seems under windows I'm missing some aspect of the chain of
command, I do have to do more testing
to determine if there is any thing "on the wire" that could be giving
windows cause for concern.

I suspect my use of the flow control lines to indicate data available
may be causing the windows a problem.

Cant remember the fconfigure off the top of my head, I'll post it
later.


Regards,
Rolf.


Thanks

Derek
.



Relevant Pages

  • Re: Special Character Problem
    ... My company uses a special character as a part of a password for an ftp account a Linux server, and I cannot seem to get Fedora 9 to connect to the server as a result. ... All the Windows and even Mac clients that connect to that server seem to have no problem, it's just that I can't seem to get another Linux box to do the same. ...
    (Fedora)
  • Re: I/O "mistery" or compiler bug?
    ... Linux was installed on the PowerPc, ... installation is so "strange" that many apps such as GNOME do not work. ... so well for "importing" Windows text to Unix land. ... don't know if that can show non-printing character. ...
    (comp.lang.fortran)
  • Re: Screen and image size
    ... in Linux. ... the image size is perfect in both of Windows cases. ... I am using Kickstart to adjust the settings in X Configurator. ...
    (linux.redhat)
  • Re: Existing DSL not detected by re-install
    ... That's written on the bottom of the modem for "Advanced Modem ... "The modem is reported to work under Linux out of the box." ... The card works on the Windows side, and *did* work on the Linux side. ... I don't want to change *standard* settings. ...
    (alt.os.linux.suse)
  • Re: Debian Display on Virtual PC 2004
    ... The MS VirtualPC works great on windows with other versions of ... It will support linux, I have tested a few distros myself. ... > and check your video card and resolution settings. ...
    (Debian-User)