FTDI-LA

From sigrok
Revision as of 19:22, 28 April 2022 by Tchebb (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Raw FTDI chip digital inputs
Chronovu la8 ftdi ft245rl.jpg
Status supported
Source code ftdi-la
Channels 8
Samplerate 10MHz
Samplerate (state)
Triggers none (SW-only)
Min/max voltage 0V — 5V
Memory none
Compression none
Price range $2 - $27

There's a best-effort driver to acquire raw samples from any FTDI chip supporting bitbang modes. As these chips have tiny I/O buffers, it doesn't guarantee overrun-free operation so it may lose samples, yet moving the device to a separate USB host or lowering the sample rate helps.

Hardware

FT232RL and FT2232H are known to work, and adding an unsupported chip should be easy. Boards with the former are available on ebay for $3, but it doesn't support USB 2.0 hence sample rates will be lower. FT*H chips may provide ~20MHz sample rate over a reliable high speed USB link and (bursts of?) 60MHz using synchronous FIFO mode (not implemented in the sigrok driver).

Pitfalls

This driver currently only supports FTDI chips configured in bitbang mode. This means you cannot use the driver with a board where an EEPROM configures the FTDI device to operate in a different mode. This means the driver doesn't work with Bitscope devices, for example.

I've tried to use FT232RL to capture UART serial transmission and the timing was waaay off, so it didn't worked out even on low baudrates. Sometimes it seemed like the sample rate was half of announced value, sometimes it was completely off. This probably still needs lots of tweaking if you want to do some serious protocol decoding business. (Haven't tried the FT*H chips, they are supposed to work better)

FT232R Support Removal

Note: Please do not remove or rename this section. It is linked to from a warning message that new versions of libsigrok will print when they detect an FT232R.

A pending pull request, sigrokproject/libsigrok#145, removes support for the FT232R from FTDI-LA because that chip has an unavoidable silicon erratum that results in extreme clock jitter when sampling (or writing to) its I/O pins in bitbang mode. Due to this erratum, the chip is unsuitable as a logic analyzer and has always produced bad data when used with sigrok. In fact, FTDI-LA used an incorrect FT232R clock divisor for years and no one noticed. If you need an FTDI chip that can function as a logic analyzer, consider an H-series chip (e.g. FT232H), or the FT230X/FT231X.

See FTDI's TN_120, "FT232R Errata Technical Note", for more details of the erratum. Note that all silicon revisions (A, B, and C) are affected, and that FTDI's proposed workaround of always sampling at 3MHz is not feasible due to USB bandwidth limitations. There are numerous other reports of this issue on the internet as well: here, here, here, here, here, here, and here for example.

Windows

On Windows, you'll need to assign the "WinUSB" driver to the device, otherwise the ftdi-la driver will not be able to find or use it.