[Rxtx] Latency Woes
hakcenter at gmail.com
Tue Mar 8 01:33:24 MST 2011
I am going to try a couple things today and hopefully figure something out.
Bob I don't want to pop your bubble, but a native application named
'TunerPro' can sample the same data, over 30 sensors, in less than 25ms.
I've exchanged some emails with the author and it is a native C,
polling, no events just timeouts.
Kusta thanks for the FTDI notice, I believe that is tunable, however I
have a particular user using a Keyspan converter and verified sampling
rate with 'TunerPro' and its just off the charts.
Chris thank you, I'll look into the queing.
On 03/07/11 23:02, Bob Jacobsen wrote:
> If you're transferring three bytes total at 1953 baud, it's going to take 3*(8+2)*1000/1953 = 15.4 msec no matter what. Having to wait 20msec to get the data back instead of 15.4 msec doesn't seem to be as big a problem as you're making it sound.
> On Mar 7, 2011, at 8:04 PM, Curtis Hacker wrote:
>> I guess I'm gunna need some serious help with this then, because of the scenario I'm stuck with.
>> To communicate there is only 1 data line, rx/tx tied together with a diode protecting the tx. No RTS/CTS handshaking nothing..
>> So the ecu can't process the next byte of info, without you pulling the 2 bytes back. I wish this was standard, but even the baud rate isn't (1953). OBD1.5 crap. I am really stuck in a hard spot with this..
>> in.read(data, 0, 2);
>> ^ would the above wait till the timeout to read 2 bytes ? or read 1 byte wait for the 2nd ? or just read the 1 ??
>> On 03/07/11 18:50, jfh at greenhousepc.com wrote:
>>> No, I assume he means a real queue, not just "don't read all the bytes at once." However, if you know you can process some number of requests in some amount of time, allowing data to pile up (receiver FIFO space permitting) can be a valid strategy. Inserting gobs of Thread.yield() and notify() can help pep things up as well.
>>> Julie Haugh
>>> Senior Design Engineer
>>> greenHouse Computers, LLC // jfh at greenhousepc.com // greenHousePC on Skype
More information about the Rxtx