Author Topic: Is this ftdi ft232 circuit correctly made?  (Read 1474 times)

0 Members and 4 Guests are viewing this topic.

Offline tesliniusTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: nl
Is this ftdi ft232 circuit correctly made?
« on: August 22, 2021, 10:27:45 pm »
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?
« Last Edit: August 22, 2021, 10:29:22 pm by teslinius »
 

Online oPossum

  • Super Contributor
  • ***
  • Posts: 1447
  • Country: us
  • Very dangerous - may attack at any time
Re: Is this ftdi ft232 circuit correctly made?
« Reply #1 on: August 22, 2021, 11:00:34 pm »
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.
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 6215
  • Country: de
Re: Is this ftdi ft232 circuit correctly made?
« Reply #2 on: August 22, 2021, 11:05:41 pm »
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.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7158
  • Country: pl
Re: Is this ftdi ft232 circuit correctly made?
« Reply #3 on: August 23, 2021, 06:14:42 am »
Yeah, but OP isn't doing RS-232 :P

It 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.
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 6215
  • Country: de
Re: Is this ftdi ft232 circuit correctly made?
« Reply #4 on: August 23, 2021, 10:08:22 am »
Yeah, but OP isn't doing RS-232 :P

Then why does he ask about TX/RX level shifters?
 

Online mikerj

  • Super Contributor
  • ***
  • Posts: 3317
  • Country: gb
Re: Is this ftdi ft232 circuit correctly made?
« Reply #5 on: August 23, 2021, 11:43:56 am »
Yeah, but OP isn't doing RS-232 :P

Then why does he ask about TX/RX level shifters?

He was talking about 3.3/5v logic shifting I think, not RS232 levels.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13056
Re: Is this ftdi ft232 circuit correctly made?
« Reply #6 on: August 23, 2021, 11:51:42 am »
Yeah, but OP isn't doing RS-232 :P

Then why does he ask about TX/RX level shifters?

He was talking about 3.3/5v logic shifting I think, not RS232 levels.

Exactly.  I believe he's using a 3.3V MCU and hasn't realized that on a FT232R you 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.
 

Offline tesliniusTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: nl
Re: Is this ftdi ft232 circuit correctly made?
« Reply #7 on: August 24, 2021, 09:23:11 pm »
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
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13056
Re: Is this ftdi ft232 circuit correctly made?
« Reply #8 on: August 24, 2021, 09:42:50 pm »
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.
 

Offline tesliniusTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: nl
Re: Is this ftdi ft232 circuit correctly made?
« Reply #9 on: August 24, 2021, 09:59:10 pm »
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?
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13056
Re: Is this ftdi ft232 circuit correctly made?
« Reply #10 on: August 24, 2021, 10:34:51 pm »
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 cable TTL-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!/
 

Online oPossum

  • Super Contributor
  • ***
  • Posts: 1447
  • Country: us
  • Very dangerous - may attack at any time
Re: Is this ftdi ft232 circuit correctly made?
« Reply #11 on: August 24, 2021, 10:40:51 pm »
Using FT230X in the self-powered configuration also would solve this problem.

« Last Edit: August 24, 2021, 10:44:02 pm by oPossum »
 
The following users thanked this post: Ian.M

Offline tesliniusTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: nl
Re: Is this ftdi ft232 circuit correctly made?
« Reply #12 on: September 03, 2021, 09:10:27 am »
Is the circuit correct now?, i'm not gonna drive the rx pin in software
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13056
Re: Is this ftdi ft232 circuit correctly made?
« Reply #13 on: September 03, 2021, 12:36:15 pm »
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.
 
The following users thanked this post: teslinius


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf