Lets say that I needed to send sensor readings in increments of 100 bytes from a micro controller to a laptop with sub 2 ms latencies in real time (the data needs to be processed and acted upon immediately (to control a robot)). What interfaces would one use?

FTDI usb-serial converters aren't an option because they introduce 5-10 ms latencies both ways. PCI cards are an option though.

  • $\begingroup$ Store data in your laptop (e.g. txt file) and delay the receiving process through an independent thread. $\endgroup$ – CroCo May 8 '16 at 18:52
  • $\begingroup$ I forgot to mention that it needs to be processed in real time (my bad). I'll update the question. $\endgroup$ – David May 8 '16 at 19:05
  • $\begingroup$ The comment is still valid though. $\endgroup$ – CroCo May 8 '16 at 19:10
  • 1
    $\begingroup$ What kind of sensor data? What processing? Does the 2ms include the transfer of the data to the laptop only or also the processing? $\endgroup$ – Bending Unit 22 May 8 '16 at 21:12
  • 1
    $\begingroup$ It actually turns out that most of the latency is added by whatever is converting serial to usb/pci/ect. FTDI usb-serial chips add 5 to 10 ms of latency no mater what the baud rate is (at least with the chips I've experimented with) $\endgroup$ – David May 10 '16 at 22:38

Off the shelf expresscard or cardbus cards for rs422/485 will do 921Kbit/sec which, depending on the protocol you use and its overhead, should get you more than 100Bytes of data in less than 2ms.

Considering the ease at which you can use RS422 with a microcontroller this is the first thing to try. You can even forgo a protocol and use the raw communications during development to get up and running quickly (though for robustness, a protocol that can handle errors and comms start and stop will be wanted).

Ethercat is the other option, which can use a standard ethernet card, (if you are lucky your laptop will use a compatible chipset), but you will need to add an Ethercat chip and ethernet phy on the microcontroller side. Additionally, Ethercat uses a robust but complicated communication protocol so it can take some time to learn. The benefit of doing so is that you have fast communications designed for realtime control.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.