2

I am using an FTDI USB to UART breakout bridge. It has an inbuilt timer, the Receive Buffer Latency Timer, that starts timing when a piece of data is received to a buffer and on timeout then sends data. This timeout is set as a default to 16 milliseconds.

The documentation states that when using Windows and D2XX drivers this timeout can be altered by changing the value in the ftdiport.inf file as follows:

[FtdiPort.NT.HW.AddReg]
HKR,,"LatencyTimer",0x00010001,16 

I am instead using Linux and reading values from a VCP (using /dev/ttyUSB0). How would I access and change the equivalent of the .inf variables that I would find in this set-up?

Should I instead be writing directly to registers on the micro-controller? If so how do I differentiate between registers on the bridge and registers on the sensor I am using the bridge to connect to?

1 Answers1

2

You are probably looking for the setserial command.

This command gives you much less control than does the .inf file:

setserial /dev/ttyUSB0 low_latency

For a more exact setting, you might be able to set the FTDI Latency Timer (if it is not locked against updates):

#cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
16
# echo 1 > /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
# cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
1

This will lower the timer from 16ms to 1ms (the minimum), to reduce latency.

harrymc
  • 498,455