LoginSignup
4
1

More than 1 year has passed since last update.

FTDI の USBシリアルチップ FT232 の速度パフォーマンス問題

Last updated at Posted at 2022-06-22

FT232 は 電子工作で定番の FTDI の USBシリアルチップであるが、他の USBシリアルチップに比べると転送速度が遅いらしい。

比較実験した資料

「FTDI より Silicon Labs の USB シリアルを使った方が良い理由」
https://qiita.com/hira_kuni_45/items/ee157ff6a1996243e117

上の記事ではFTDI FT232XS および FT232RL と Silicon Labs CP2102Nを比較して、約3倍の違いということが示されている。

  • 通信条件 230400bps N81
  • 628460 バイトイメージを使い、 RX64M マイコンのフラッシュ書き換え時間
  • FT232XS および FT232RL
    • 5:57.08
    • 17603bps
  • Silicon Labs CP2102N
    • 1:51.59
    • 56112bps

原因 ?

「FTDIドライバにおけるLatancyTimerについて」
https://www.hdl.co.jp/USB/FTDI/lt/

この記事によると、FTDIドライバ内のレイテンシ設定が 16ミリ秒になっているのが問題?

元ネタは下記のFTDI公式のアプリケーションノート。

「AN232B-04 Data Throughput,Latency and Handshaking」
https://www.ftdichip.com/Documents/AppNotes/AN232B-04_DataLatencyFlow.pdf

3.2
AN232B-04 Data Throughput, Latency and Handshaking Adjusting the Receive Buffer Latency Timer FTDI's R, C and BM series chips allow the latency timer to be changed from 16 milliseconds to any value from 1 to 255 milliseconds, in 1 millisecond increments. When using the FTDI Virtual COM Port driver the latency timer can be set in the port properties page. In Windows, the port properties page is accessed via the Control Panel > System > Device Manager. For Windows 2000 and XP,the initial value of the latency timer can also be pre-configured in ftdiport.inf by changing the value of the last number in the following line:

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

where again, 16 milliseconds is the default value.

When using FTDI's D2XX direct driver the function FT_SetLatencyTimer can be used to adjust thevalue of the latency timer.

とあります。しかしながらこれ、2006年の文書。ハードウェアに由来する制限ではないので、ドライバの改訂とかで状況が変わるかも。今はどうなのかな?

今どきの FT232チップ

西暦2000年代は FT232RL が定番だったけれども今では別のシリーズも多くある。電子工作によく使われるモジュールとしては、例えば、ストロベリーLinuxの以下の商品は FT232HL 搭載モジュール。
https://strawberry-linux.com/catalog/items?code=50028
FT232H は 480MBps 出るとのこと。

ストロベリーLinuxの以下の商品は同じFTDIの FT231X。
https://strawberry-linux.com/catalog/items?code=50121
FT231Xは2013年ごろから出回りだしたもの。後述の資料によると、FT232と同じ問題があるようだ。

スイッチサイエンスの以下の商品はFT231XS。
https://www.switch-science.com/catalog/2782/

秋月電子の FT232RL 搭載ケーブル。
https://akizukidenshi.com/catalog/g/gM-08343/
秋月電子の FT232RQ 搭載ケーブル。
https://akizukidenshi.com/download/ds/ftdi/TTL-232R.pdf
秋月電子の FT232RL 搭載モジュール。
https://akizukidenshi.com/catalog/g/gK-06693/
秋月電子の FT231X 搭載モジュール。
https://akizukidenshi.com/catalog/g/gK-06894/

以下2つは FT232 でもなく、 FT231 でもないが同様によく使われているもの。FT232と同じ問題があるかどうかは不明。

秋月電子の FT234X 搭載モジュール。
https://akizukidenshi.com/catalog/g/gM-08461/
秋月電子の FT2232D 搭載モジュール。
https://akizukidenshi.com/catalog/g/gM-02990/
https://docs.openbci.com/Troubleshooting/FTDI_Fix_Windows/

先の資料
「AN232B-04 Data Throughput,Latency and Handshaking」
https://www.ftdichip.com/Documents/AppNotes/AN232B-04_DataLatencyFlow.pdf

には

This application note tries to describe the major architecture differences that need to be considered by both software and hardware designers when changing from a traditional RS232 based solution to one that uses the FT232R, FT2232C (UART mode) or FT232BM USB to serial interface devices. Much of the information in this application note also applies to the FT245R, FT2232C (FIFO mode) and FT245BM USB to parallel FIFO interface devices.

とあるが、このアプリケーションノート以降にリリースされたチップも多く、どこまで該当するのか??

いまどきの MS-Windowsでの状況

幅広い状況の確認は、 openbci のサイトからうかがい知ることができた。
https://openbci.com/
ここでは、FT231X のボードが入手可能になっている。

「FTDI Buffer Fix on Windows | OpenBCI Documentation」
https://docs.openbci.com/Troubleshooting/FTDI_Fix_Windows/

には、

Tested on:

  • Windows 7
  • Windows XP
  • Windows 10

とあるので、Windows11は不明だが10までは状況は同じらしい。

Linux での状況

ここまでは Windows 用のドライバのお話だが、別OSだとどうだろう?

Linuxにおいては openbci のサイトの

「FTDI Buffer Fix on Linux | OpenBCI Documentation」
https://docs.openbci.com/Troubleshooting/FTDI_Fix_Linux/
において、



/sys/bus/usb-serial/devices/ttyUSB0/latency_timer

The latency_timer should contain 16 by default. Change this to 1, and you're done!

とあるので同様の問題があるのを見て取れる。

Mac OSX での状況

こちらも openbci の
「FTDI Buffer Fix on OS X | OpenBCI Documentation」
https://docs.openbci.com/Troubleshooting/FTDI_Fix_Mac/

において、同じ原因かどうかは不明だがパフォーマンス問題があるらしい

On some Macs, you may have noticed that the data coming from your board is very choppy.

4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1