Is this ftdi ft232 circuit correctly made? - Page 1
Forum section: electronics / projects

author: teslinius
author_rank: Regular Contributor
timestamp: August 22, 2021, 10:27:45 pm
content: I have a project where i will use ftdi ft232 chip for uart communication, microcontroller is stm32f103frct6 3.3v, it's my first time using this chip so i just wanted to make sure if i correctly made the circuit?, the only thing i'm not sure about is whether i should supply it with 3.3v or 5v and if i need a voltage level shifter for rx/tx pins and if i should also connect dp2 /dn2 pins to corresponding ones for typec connector to work in both ways?

author: oPossum
author_rank: Super Contributor
timestamp: August 22, 2021, 11:00:34 pm
content: Both sets of DP/DN must be connected for cables to work in either orientation. The CC pins should each be connected to a 5.1k resistor to ground to ensure it will work with a USB-C host. Connect Vccio to 3V3out to get 3.3V logic levels compatible with the STM32. Consider using the FT230X - it is less than half the price.

author: Benta
author_rank: Super Contributor
timestamp: August 22, 2021, 11:05:41 pm
content: For RS-232, you need a MAX232 or similar level shifter for the TX/RX pins and both the FT232 and MAX232 should be supplied from +5 V.

author: magic
author_rank: Super Contributor
timestamp: August 23, 2021, 06:14:42 am
content: Yeah, but OP isn't doing RS-232It looks like you may be trying to connect TX-TX and RX-RX. Typically, TX is the pin that transmits bits and RX is the one that receives, so you want to connect TX-RX, RX-TX unless your particular MCU's pins are labeled weird.

author: Benta
author_rank: Super Contributor
timestamp: August 23, 2021, 10:08:22 am
content: Quote from: magic on August 23, 2021, 06:14:42 amThen why does he ask about TX/RX level shifters?

author: mikerj
author_rank: Super Contributor
timestamp: August 23, 2021, 11:43:56 am
content: Quote from: Benta on August 23, 2021, 10:08:22 amHe was talking about 3.3/5v logic shifting I think, not RS232 levels.

author: Ian.M
author_rank: Super Contributor
timestamp: August 23, 2021, 11:51:42 am
content: Quote from: mikerj on August 23, 2021, 11:43:56 amExactly. I believe he's using a 3.3V MCU and hasn't realized that on aFT232Ryou power VCCIO with your desired logic high level to set the logic levels of its serial side.VCCIO must be between 1.8V and VCC and if there are multiple power domains in the system, must be derived from the same source as FT232R VCC, as it must *NEVER* be powered when VCC is not. For a 3.3V target and a USB bus powered FT232R , these constraints are easy to satisfy by powering VCCIO from the FT232R's internal 3.3V regulator, via its 3.3V pin.However there is still one other issue. If the design powers the FT232R from USB Vbus and the rest of it from another source (a very common design decision for low power battery gadgets), its essential *NOT* to drive the FT232R inputs when USB Vbus is not present. That's easy enough to do in software, just provide a potential divider that reduces Vbus to a convenient voltage for your MCU to sense, and if it goes away, immediately turn off the UART output and any related handshake outputs. In hardware its a bit trickier and the easy option may be to use level translating buffers rated for partial powerdown anyway, (e.g. 74LVC1T45 or 2T45) not for their level shifting but for their isolation when partially powered. A low threshold (~1.5V) N-MOSFET, gate to VCC/Vbus, and drain towards the MCU may also be suitable, if you put 10K from Vbus to Gnd to discharge its gate and the decoupling caps. That gives 1.7V 'headroom' to keep the MOSFET on when the MCU is outputting logic '1', assuming Vbus is at it nominal 5.0V. If Vbus is at the minimum permitted, it may clip the logic '1' level seen by the FT232R slightly. Note that this approach is impractical for isolating 5V logic.

author: teslinius
author_rank: Regular Contributor
timestamp: August 24, 2021, 09:23:11 pm
content: I'm just trying to use ft232 for uart communication with pc, no rs232, the rx/tx pins are correctly connected, i just had the net port names from the ft232 instead of the uc, does the circuit look ok now?, read the datasheet but didn't know that vccio sets logic levels must'be missed it, thanks

author: Ian.M
author_rank: Super Contributor
timestamp: August 24, 2021, 09:42:50 pm
content: That's OK *IF* the regulator supplying your +3.3V rail is fed from the +5V Vbus supply, and *ONLY* that supply. If not, connect VCIO to the FT232R's internal 3.3V regulator output on its 3V3OUT pin. However if that's the case, see my comments above about not driving the FT232R RXD pin when the USB (and its +5V Vbus powering the FT232R) is disconnected.

author: teslinius
author_rank: Regular Contributor
timestamp: August 24, 2021, 09:59:10 pm
content: No it's not, the regulator is fed from a separated 12v supply circuit, like this?, wait what's the problem when 5V usb supply is disconnected with the rx pin?

author: Ian.M
author_rank: Super Contributor
timestamp: August 24, 2021, 10:34:51 pm
content: As I said earlier, you should *NEVER* power VCCIO without powering the FT232R's VCC pin as well. See the description for the pin on page 7 of the datasheet + the fig. 6.4 schematic page 22, except you are powering your MCU separately, not from the FT232R's on-chip regulator as shown there.If you violate this VCCIO restriction, the FT232R may not power up correctly when you plug the USB in. I suspect it may under certain circumstances simply fail to initialize as FTDI sell a FT232R based cableTTL-232RG-VIP-WE, that has an external VCCIO connection but no 3.3V or 5V output to power it from so its very unlikely to do something dangerous like destroy itself due to latchup, provided you don't do something stupid like driving a signal >0.5V into RX when its not powered, which is implicitly forbidden by the specified abs.max. input voltage range of -0.5V to +(VCC+0.5V), when VCC is 0V. Your 1K isolation resistors would *PROBABLY* prevent damage, but as there is no permitted input overdrive current spec. in the datasheet, one can't guarantee that without either extensive testing or input from FTDI's engineering support.See EEVblog #831 for a general introduction to 'parasitic' power in CMOS chips:Comments thread here:https://www.eevblog.com/forum/blog/eevblog-831-power-a-micro-with-no-power-pin!/

author: oPossum
author_rank: Super Contributor
timestamp: August 24, 2021, 10:40:51 pm
content: Using FT230X in the self-powered configuration also would solve this problem.

author: teslinius
author_rank: Regular Contributor
timestamp: September 03, 2021, 09:10:27 am
content: Is the circuit correct now?, i'm not gonna drive the rx pin in software

author: Ian.M
author_rank: Super Contributor
timestamp: September 03, 2021, 12:36:15 pm
content: Looks reasonable.You still need some way of detecting if the USB is unplugged so your MCU firmware can disable its TX e.g. by connecting a potential divider to Vbus (5V), 18K upper, 33K lower, with the tap to a GPIO input on your MCU.