FTDI USB interface to Propeller circuit variations
Don M
Posts: 1,652
In a project I am developing I am looking to incorporate the FTDI FT232R series chip for a USB interface. I was looking at several circuit designs and I noticed several variations regarding the I/O voltage interface to the Propeller RX / TX pins.
In Ray's Logic PSB board he uses a FT232RL but according to his schematic does nothing with the 3.3 volt output from pin 17 but instead uses the USB 5 volt supply to feed the VCCIO pin 4 and then uses a 1K resistor to limit voltage to connect to the Prop on the RX and TX pins.
On the Propeller development USB boards they use a FT232RQ and utilize the 3.3 volt regulated output from the FTDI chip to drive the VCCIO so there can be a direct connection between the FTDI chip and the Prop without resistors. The same goes for the Prop Plug adaptor. Simple.
However on the Quickstart board they utilize the FT232RL and also tie the VCCIO to the USB 5 volt and instead use a 74LVC126A Quad buffer / line driver fed with the 5 volt serial signal from the FTDI chip but the VCC on the 74LVC126A is powered from the 3.3 volt regulator from the FTDI chip for direct connection to the Propeller RX / TX pins. Seems rather convoluted.
So is there a preferred way to do this? Have there been some issues in doing it one way versus another?
What am I missing here....
Don
In Ray's Logic PSB board he uses a FT232RL but according to his schematic does nothing with the 3.3 volt output from pin 17 but instead uses the USB 5 volt supply to feed the VCCIO pin 4 and then uses a 1K resistor to limit voltage to connect to the Prop on the RX and TX pins.
On the Propeller development USB boards they use a FT232RQ and utilize the 3.3 volt regulated output from the FTDI chip to drive the VCCIO so there can be a direct connection between the FTDI chip and the Prop without resistors. The same goes for the Prop Plug adaptor. Simple.
However on the Quickstart board they utilize the FT232RL and also tie the VCCIO to the USB 5 volt and instead use a 74LVC126A Quad buffer / line driver fed with the 5 volt serial signal from the FTDI chip but the VCC on the 74LVC126A is powered from the 3.3 volt regulator from the FTDI chip for direct connection to the Propeller RX / TX pins. Seems rather convoluted.
So is there a preferred way to do this? Have there been some issues in doing it one way versus another?
What am I missing here....
Don
Comments
The VCCIO pin sets the output voltage level in theory. However in practive even when set to 5V the output pins seem to remain closer to 3.3V. I don't remember exactly what we measured, but there wasn't much difference between 3.3V on VVCIO and 5V on it. You could, however, test this yourself as I think our tests predated the "R" chip.
The thing to worry about is the Propeller powering up the FTDI chip and causing a reset.
The Quickstart uses a logic buffer to prevent that.
I use a 1k resistor to do the same thing and it seems to work.
I had a good reason for running the FTDI logic at 5V, but I don't remember what it was
Update: I just remembered... I have the FTDI logic at 5V so that I can use a simple p-channel
mosfet to allow the FTDI chip to control the +5V power as recommended in the datasheets....
It would be the same as if you left the Prop Plug connected all the time to a dev board.
Has it been proven that can happen?
The 74LVC2G07 is open-drain and needs pullups on both outputs. Also, I neglected to add a pullup from A30 to Vdd in the above circuit. There needs to be one. For best performance at higher baud rates, I'd change all the pullups to 4.7K.
-Phil
I have always used the 3v3 for I/O power on boards with FT232RL. There is also a circuit in the FTDI datasheet which holds the FT chip in reset when there is no USB supply.
So the solution depends on the application.
BTW The prop provides power via the output pin and the protection diodes in the FTDI chip route this to the power rail in the FTDI chip. This is a common protection mechanism in many/most modern chips these days but is probably not seen because the power is usually derived from a single source. This is not always the case in USB devices.
Turns out they were using FullDuplexSerial in there code that provided power to the Prop's TX pin.
This powered up the FTDI chip slowly (minutes) and as soon as it powered up, it reset the Prop....
@Phil- could you have found a smaller IC? ... I have to make this one in Diptrace.
Edit: So Phil just to be clear- you need pullups on both P30 & P31 to the Props VDD?
Define "higher baud rates". Would 115K be considered high?
Indeed there are many ways to configure the FTDI chip to accomplish various design goals
I really strongly suggest using two 1-bit buffers (with enable) for the TXD and RXD pins. See the attached example image. If you are using the RTS and CTS pins, you would want two 2-bit buffers (with enable).
Not only do you have to worry about the Propeller powering the FTDI chip through the protection diodes on the I/O pin, but you also don't want the FTDI chip powering the Propeller and other circuittry through it's I/O pins (for example when USB is plugged in but the board is switched off).
For the buffers I really strongly suggest using the 74LVC series or devices with similar type of operation (the examples shown earlier are from this series). They have inputs which are tolerant to being driven while the device is off, and are commonly used for this kind of application and for level-shifting. In most other devices, if inputs are driven when the device is off, it will flow up into the supply rail through internal protection diodes and likely power the device on. The 74LVC devices are designed for this not to happen.
Also, I suppose you could use open-drain type buffers with pullups, but you could also use normal type buffers with enabled outputs (which is what is used in the attached schematic example). It doesn't hurt to have very large pull-ups in that case (maybe around 100k) just so it floats the line high when the outputs are disabled (when they become high-impedance). Using standard driving buffers will be slightly more power efficient, and will eliminate the concern over speed due to the pull-up value.
Really either type of buffer should work (open-drain versus standard drive) but I would really suggest having buffers going in both directions.
As a point of reference for the open-drain buffer, I wrote a short program to test the rise time of an open-drain output (pulled up to 3.3V with a 4.7K resistor, and driving a typical capacitive load -- in this case another Prop pin). It uses FullDuplexSerial in OPEN mode at 230400 baud:
Here's what the output looks like:
Even at this baud rate, the rise time should not be an issue; but as Kevin points out, the power consumption will be somewhat higher (by about 350uA average per pin when running full tilt at 50% duty cycle).
-Phil
The serial port speed would be maxed at 115K. So is there really a need to go with buffers with an enable or am I good to go with what I have?
I'd include a 500mA USB VBUS protection (polyfuse) plus resolve a 'conflict' when applying both external and USB power supplies simultaneously.
Look at the elegant circuit variants used in various Arduino designs - see Netduino example below
Also, I use an inductor (or ferrite bead) in series with the fuse.
In your schematic, you also need a pullup from the buffer's "2Y" output to VCCIO. It should work fine at 115200 baud.
What "conflict" are you referring to? He's not powering the rest of his circuit from the USB port -- only the FTDI chip and the buffer.
-Phil
There can be a conflict if you try to accomodate both USB power and external power... In that case, it's a good idea to use diodes to make sure power only goes the way you want...
@Phil- comment about resistor noted and changed.