FTDI Community

General Category => Discussion - Software => Topic started by: Slava on January 01, 2024, 03:11:36 PM

Title: Need to use FT4232H Port A in all modes I2C/SPI/JTAG/UART
Post by: Slava on January 01, 2024, 03:11:36 PM
I need to use port A of the FT4232H in all I2C/SPI/JTAG/UART modes and switch between them in software. I don't see any problem in switching between I2C/SPI/JTAG, but I don't understand how to switch it from I2C to UART. Please help!

Regards,
Slava
Title: Re: Need to use FT4232H Port A in all modes I2C/SPI/JTAG/UART
Post by: Slava on January 04, 2024, 12:04:50 PM
Hi,

I realized that the only option I have is to use bitbang mode and implement the UART protocol myself. It's not a problem, I just need to send 10 bytes for every byte I actually wanted to send. However, when I use FT_SetBaudRate() to set the UART speed, the resulting speed is 5 times faster than I expected. So to get 115200 I have to call FT_SetBaudRate(115200/5). What am I doing wrong?

Regards,
Slava
Title: Re: Need to use FT4232H Port A in all modes I2C/SPI/JTAG/UART
Post by: FTDI Community on January 04, 2024, 03:42:27 PM
Hi,
If you use FT_SetBitMode to reset (zero for reset)   
https://ftdichip.com/wp-content/uploads/2023/09/D2XX_Programmers_Guide.pdf (https://ftdichip.com/wp-content/uploads/2023/09/D2XX_Programmers_Guide.pdf) (Page 66, D2xx programmers guide)

Regards
FTDI Community
Title: Re: Need to use FT4232H Port A in all modes I2C/SPI/JTAG/UART
Post by: cioma on April 19, 2024, 12:06:32 PM
I believe you can switch between UART and MPSSE (I2C/SPI/JTAG) modes in software using set_bit_mode USB control request but I don't know if it's exposed in FTDI drivers.