1

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!!

1 Answers1

1

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.

Christian B.
  • 816
  • 6
  • 11
  • @Christiam B. Thanx for reply.. I am using D2XX for linux but I'll have to unload ftdi_sio and usbserial for this at the time of executing every program I wrote. Also it has default 115200 baud rate so I thought if it could be fixed to some other value . – Vikas Singh Aug 03 '20 at 06:24
  • Also say I changed baud rate with d2xx and want to connect to device with cutecom .. will that baudrate setting hold or not? – Vikas Singh Aug 03 '20 at 06:34
  • If you load the D2XX driver the device wont be recognized as a com port device anymore. And everytime an application establish a connection to your FT it "commands" a baud rate. If you dont set it explicitely it defaults to the used *library* default - to the best of my knowledge there is no *device* defaults. I dont know cutecom but I doubt that it supports the D2XX driver. Is there any reason for you not to use the VCP/ftdi_sio driver? – Christian B. Aug 03 '20 at 16:19
  • I actually need to change the EEPROM content and baud rate of the device. I found a very nice documentation for D2XX driver for changing these things so did'nt think about much about ftdi_sio. Is there any documentation or sample available for ftdi_sio too? – Vikas Singh Aug 03 '20 at 20:09
  • in case of the ftdi_sio/VCP you set the baud rate during the handle opening. For example, serial.Serial("/dev/ttyUSB0", 9600) in python means "open com port 0 with a baud rate of 9600". Almost every language I am aware of can do similiar for com ports. So NO need to set the baud rate in advance as it is set during the opening process anyway. – Christian B. Aug 03 '20 at 20:15
  • thanx for the suggestion I'll try this. Anyway just wanted to know if I am doing write for eeprom write. As this is one time operation I am unloading ftdi_sio using rmmod then by using D2XX I and overwriting eeprom and then again loading ftdi_sio back. I have tested and works fine. – Vikas Singh Aug 03 '20 at 20:22