libftdi Archives

Subject: Patch for FT230X baud rate selection

From: Joe Zbiciak <intvnut@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Fri, 12 Aug 2016 22:23:33 -0700
Hello,

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 http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx


Current Thread
  • Patch for FT230X baud rate selection, Joe Zbiciak <=