kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Implementing tight time constraints for read/write with USB serial (ftdi_sio)
@ 2018-09-03 19:12 Thomas Bracht Laumann Jespersen
  2018-09-04  1:22 ` valdis.kletnieks at vt.edu
  2018-09-04  5:30 ` Greg KH
  0 siblings, 2 replies; 7+ messages in thread
From: Thomas Bracht Laumann Jespersen @ 2018-09-03 19:12 UTC (permalink / raw)
  To: kernelnewbies

Hello all!

I'm working on a project where we want to integrate into a production line and
listen on connected devices, and the challenge is that our setup needs to be
fast enough.

Let me try to explain the setup.

There are some 80+ devices on the network. They are connected in a multidrop
talking PROFIBUS at a speed of 1.5MB.

I have an RS485<->USB serial cable that uses the ftdi_sio driver to listen on
the network. It is identified as a FT232RL.

Just listening and de-constructing the PROFIBUS communication blocks that are
coming through is not a problem. The problem is when I need to reply to messages
in the network.

At first I was seeing reads from the serial port taking either ~.002ms or ~16ms,
which I assume is due to buffering on the chip. I then learned about setserial
and tried adjusting the latency to 1ms. This gives me read times at around ~4ms
on average (but sometimes going above 10ms). I'm looking for ways to
disable/minimize the buffering on the FTDI chip, but I also suspect that the
ftdi_sio driver does some buffering.

The challenge is that my application needs to act within 100 tbits, ie in around
~.066ms. That is the window in which I need to begin transmitting a reply. Is
there a way to achieve this with the ftdi_sio driver or do I need dedicated
hardware for this?

I guess my question is: Is it possible to achieve sub-millisecond response times
in a "standard" Linux (ie a desktop variant)? Or is it necessary to look into
real-time Linux or other specific kernel configuration?

As an aside, I'll mention that I've looked into libftdi as an alternative (could
it be?), but since it specifically unloads the kernel driver I'm not sure I
should be asking about that here :-)

To be honest, I'm not sure if kernelnewbies is the right place to ask, if not,
I'll be happy to take my questions elsewhere :-)


All the best,
-- Thomas

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-09-05 11:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-03 19:12 Implementing tight time constraints for read/write with USB serial (ftdi_sio) Thomas Bracht Laumann Jespersen
2018-09-04  1:22 ` valdis.kletnieks at vt.edu
2018-09-05  9:46   ` Thomas Bracht Laumann Jespersen
2018-09-04  5:30 ` Greg KH
2018-09-05 10:25   ` Thomas Bracht Laumann Jespersen
2018-09-05 10:48     ` Greg KH
2018-09-05 11:07       ` Thomas Bracht Laumann Jespersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).