Search code examples
usbuartftdibaud-rate

Is there any way we can change the default baud rate of FT230X devices in ubuntu 20.04 system?


I have an FT230X device from FTDI, Which is preconfigured for 115200 baud rate by default. For windows system, they have provided FT_PROG utility for changing settings, but for Linux FT2XX device driver is there.

I am able to change the baud rate from the C program by using this FD2XX driver but it's not a permanent change.

It reverts back to 115200 baud rate when shutdown or replug the device.

Is there any way we can change the default baud rate of FT230X devices in Ubuntu.

Please help!!


Solution

  • If I understand your questions correctly, it implies some missconcept about how the FTDI UART bridges work:

    1. There are two different "ways" to address a FTDI USB-UART-bridge: Virtual Com Port (VCP) or D2XX driver. The former is very confinient and allows to every program to address the bridge IC as a com port. The D2XX allows a much deeper control and access to GPIOs, non UART protocols (if supported), latency settings etc. Under windows both drivers can be switched "on-the-fly", while under unix systems a "manual" driver switch is maybe required.

    2. If one uses the VCP driver and opens a handle to a com port the baud rate can be set during this. E.g. in python serial.Serial("/dev/ttyUSB0", 9600). Similar one can set the baud rate of an FT devices using the D2XX driver (FT_SetBaudRate). However the baud rate setting is "per opening". Why it is not a permanent setting? Because the baud rate is meaningless if no handle is open as no operation can take place and it is common practice to set the baud rate if one opens a COM port anyway.