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
<https://www.intra2net.com/en/developer/libftdi/documentation/ftdi_8c_source.html#l01255>.
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.

http://developer.intra2net.com/mailarchive/html/libftdi/2014/msg00056.html

-- 
We sell spatulas, and that's all!
http://spatula-city.org/~im14u2c/
http://spacepatrol.info/


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [email protected]   

Reply via email to