Patch for FT230X baud rate selection

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Patch for FT230X baud rate selection

Joe Zbiciak

I'm trying to use an FT230X with libftdi. 

It appears libftdi doesn't correctly compute the FT230X baud rate divisor.  AFAICT, it's supposed to be computed the same as the FT232R and related devices.  I determined this by looking at the corresponding code in the Linux kernel's fdti_sio.c.

I patched my local copy by modifying line 1255 in ftdi.c.  It currently reads as follows:

else if ((ftdi->type == TYPE_BM) || (ftdi->type == TYPE_2232C) || (ftdi->type == TYPE_R ))

I changed it to read:

else if ((ftdi->type == TYPE_BM) || (ftdi->type == TYPE_2232C) || (ftdi->type == TYPE_R) || (ftdi->type == TYPE_230X))

Prior to the change, I was unable to set a baud rate of 2000000.  After the change, it worked correctly.  I haven't tested other baud rates.  I did, however, compare the code to the Linux kernel code, and it uses the same baud rate computation for the X series as it does for the BM and R series.

I haven't seen any discussion of this issue recently in the list archives.  I did find one thread from over 2 years ago, but it didn't end with a fix.


libftdi - see for details.
To unsubscribe send a mail to [hidden email]