Shop OBEX P1 Docs P2 Docs Learn Events
Can Parallax do something about the FTDI reset bug? — Parallax Forums

Can Parallax do something about the FTDI reset bug?

KyeKye Posts: 2,200
edited 2013-02-09 00:04 in Propeller 1
So, I just finished up a robotic project for a fellow classmate, and when I took the programing cable out and started to run the device by itself it kept reseting over and over again.

I managed to fix it by disabling all the code involving serial data transfer. However, I would rather of not had to do that.

Now I know this issue has been brought up before. But can Parallax do an official review of the problem and publish a paper or something on how to avoid it?

I know the problem is not the propeller chip's fault but its not to my advantage or anyone else's advantage that this bug is only known about and the fix is·buried deep within these forums. Maybe at least there should be an official sticky on this so that everyone knows.

Thank you,

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
«13

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-10-12 00:00
    Kye, are you just talking about your software crashing because it is waiting to run commands from the programming port and the FTDI chip is bus powered and so pulls the rx line low when disconnected? Surely you just want break detection and rejection in your serial code (which BTW should be standard). Otherwise you may just need a pullup on the reset line if you have it running more than a very short distance.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • RaymanRayman Posts: 14,665
    edited 2009-10-12 00:05
    I've found (at least I'm pretty sure) that putting series 1k resistors on the RX and TX lines·avoids the problem...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2009-10-12 00:05
    Phil said...
    This is a known problem with the USB circuitry when it's not plugged into a USB port. Put a 2.2K pullup from A30 to Vdd, and the problem should go away. Here's a link that explains why:

    forums.parallax.com/forums/default.aspx?f=25&m=192068

    The pullup isn't the best solution, since it's actually being used to power the FTDI chip. nono A better solution would be buffer circuitry between the FTDI chip and the Prop, so current doesn't backfeed through the FT232R's serial I/O pins.




    More Info:

    http://forums.parallax.com/showthread.php?p=651731

    Post Edited (Bob Lawrence (VE1RLL)) : 10/12/2009 12:28:43 AM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-12 01:16
    Here's another thread by yet another (I think) victim of this issue: http://forums.parallax.com/showthread.php?p=847305. In the face of so many complaints about this, spanning more than two years, it would be nice if Parallax would at least acknowledge that a problem exists. Although it's too late for a full solution to the problem where the Prop Plug is involved (the required open-drain buffer needs access to both Vdd and VccIO supplies), it's not too late to begin designing this buffer into boards that include both the Prop and FTDI chip.

    For Prop Plug users, of course, the solution is simpler: just unplug the USB cable and Prop Plug, instead of just the USB cable.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 10/12/2009 1:25:08 AM GMT
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2009-10-12 01:26
    Hey guys,

    I've met Fred Dart from FTDI (one of the owners), having visited us before here in Rocklin in recent years. I'm aware of the problem, too, but may need a definitive explanation of the problem AND the solution before we start making requests.

    Phil, can you brief me on the FULL solution you mention above so I'm making the right request to Fred?

    Thanks,

    Ken Gracey
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-12 01:55
    Ken,

    Thanks for joining the discussion! Now I know we'll see some action! smile.gif

    The problem is this: When the USB cable is unplugged, a program that uses pin A30 for a serial output will assert that pin high after reset. This, in turn, will power the FTDI chip through its RXD input pin, which causes the DTR# output to rise, sending a reset back to the Prop. During reset, pin A30 tristates, and the FTDI chip loses power until the Prop comes out of reset again, starting the cycle all over. Putting a pullup on pin A30 "solves" the problem by keeping the FTDI chip powered during reset, thus preventing repeated edges on DTR#. But this is a poor solution, since it relies on the FTDI's internal protection diodes to keep it powered whenever the Prop is powered.

    A better solution is to isolate the FTDI chip from the Prop circuitry using an open-drain buffer like the 74LVC2G07. This chip (and the entire LVC logic family) is capable of isolating independent supplies so the chip cannot power circuitry on either side from the other side's supply or input voltages. 'Best of all it's cheap. (It's used on the MoBoStamp-pe, BTW, for this very application.)

    Here's a circuit (the "full solution") that can be used on a board that has both the FTDI chip and Prop:

    attachment.php?attachmentid=57861

    Here's a circuit for an improved Prop Plug. It's not a "full" solution, though, since any Prop board that uses it needs to have pin A31 pulled up to Vdd:

    attachment.php?attachmentid=59643

    Instead of the 74LVC2G07 on the Prop Plug, one could use a non-open-drain buffer (e.g. 74LVC2G34), which would solve the reset problem, but it would still allow a connected USB port to power the Prop through pin A31. It's better, as I pointed out above, just to unplug the Prop Plug when the USB connection isn't being used.

    But for boards with both FTDI chip and Prop, a 74LVC2G07 buffer, along with a couple pullups, is the way to go.

    BTW, this is not an FTDI problem, so I don't feel that they are responsible for providing a solution. Nor is it a Propeller issue, per se. It's just a more generic matter of how two independent circuits should be interfaced when only one is being powered.

    Thanks,
    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 10/12/2009 4:12:58 AM GMT
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-10-12 02:11
    I don't seem to have this reset problem but my circuits are a little bit different anyway. I like the little SOT style logic chips too but here is an easy retrofit solution that should work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
    751 x 362 - 11K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-12 02:22
    Peter,

    That, too, would work; but you would need second set going in the other direction to keep a powered FTDI chip from trying to power the Prop, which is another issue. The SOT 74LVC logic family has the additional advantage of 5V-tolerant inputs when powered from 3.3V — not an issue with Prop circuits, certainly, but a motivation for using it on the MoBoStamp-pe. The '2G07 buffer I recommended costs less than 11 cents on a full reel.

    -Phil
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-10-12 02:34
    Well I do totally agree with you Phil on the use of a cheap and simple buffer chip for new designs and I might use it too. The diode solution is a quick fix for a "help me out now" situation.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-10-12 02:35
    I have not thought much about the problem, not having experienced it.

    However, on my TriBlade I have the circuit which includes the 2 x 150R t/hole series resistors. I suspect this is typical of many/most t/hole designs.

    I presume the power is being supplied to the FTDI and therefore only via the SO (P30) pin of the prop. Surely, it is not the power being supplied to the prop as that is already powered???

    If this is so, firstly, we only need to worry about the SO P30 pin. Most likely a high value resistor in this line would work. Alternately, a diode in place of the 150R series resistor, cathode to P30, and a pullup on the FTDI RX pin would work - that is, we make P30 an open drain style output but without the requirement for a software modification. Either of these would most likely be the easiest and simplest circuit modification.

    I will draw a circuit and add to this post shortly.

    Phil: I think the same problem will exist with the '07 buffer -(it is open drain)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm

    Post Edited (Cluso99) : 10/12/2009 4:02:56 AM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-12 02:42
    Cluso99 said...
    Phil: I think the same problem will exist with the '07 buffer -
    It doesn't. I've used it (in the MoBoStamp-pe), and it works as advertised. The key is to use the 74LVC family, which lacks input protection diodes. Check out the datasheet; you'll see what I mean.

    Here a tutorial that explains TI's 74LVC "ioff" circuitry.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 10/12/2009 2:51:54 AM GMT
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-10-12 03:35
    You are correct Phil. I checked out the spec, but omitted to remove the statement.

    Obviously my post crossed Peter's etc. But we have the same thoughts.

    Anyway, here is my recommended circuit. The resistor is the simplest and will most likely work. A diode·(1N914 or 1N4148) and pullup resistor (10K) would be second choice.

    attachment.php?attachmentid=64347

    BTW - I have not seen any problems with the reverse situation - powering the prop from the FT chip and this I do all the time as I don not disconnect the USB when depowering my TriBlade.

    Phil is probably correct - the shield of the USB should not be connected as this is the slave end, and only one end of a shield should be connected to avoid ground loops.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm

    Post Edited (Cluso99) : 10/12/2009 4:06:49 AM GMT
    931 x 483 - 86K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-12 04:07
    A simple series resistor may not work, given that a pullup is enough to power the FTDI chip. Although the pullups that people have used to "solve" the problem are in the 1K - 2.2K range, a 4.7K resistor from the Prop pin may still provide enough current to cause trouble when A30 transitions high after reset. At the very least, I fear that it would flirt with the margins of reliability. Also, you would need the same protective circuitry going the other way on A31 to keep the FTDI chip from trying to power an unpowered Prop. (It probably wouldn't be successful, as you've observed, given the current requirements; but some have reported a faint glow from the Vdd LED in this situation, nonetheless. At the very least, the load on TXD could be excessive.) To me, at least, the LVC buffer seems the simpler and more robust solution. Plus, you gain an extra 0.6V of "low" voltage margin with a CMOS output compared to a blocking diode.

    -Phil
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-10-12 04:18
    A simple resistive load across the FTDI chip and one across the Prop will take care of those currents that find their way to the chip's supply effectively quashing the voltage. I would probably use a value of around 1K if power consumption is not an issue.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-12 04:26
    Don't forget: VCCIO only has to rise a little above 0.6V to trigger the reset transistor.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-10-12 04:30
    0.58V smile.gif (Oops, not quite. Forgot about Vfwd of the protection diode.)

    -Phil
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-10-12 04:31
    3.3V to 4K7 pullup through 0.3V substrate diode through 1K VCCIO to ground = 0.52V smile.gif

    But for new designs your idea Phil is a good way to go.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-10-12 04:32
    Yes Peter, agreed.

    I am loathe to use a hard to get component and difficult to use for a hobbyist cure. They are plentiful from Digikey. For a complete smt pcb, such as Peter, others and myself use, this is not a problem. In fact I am using SOT23 and SM8/UM8 etc parts on RamBlade which includes the LCV1G & 2G parts.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • KyeKye Posts: 2,200
    edited 2009-10-12 12:30
    Thanks guys for the input. All I really care about is that when I buy a parallax demo board and disconnect it from the PC it should still continue to work without me having to comment out my serial driver code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye,
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-10-12 12:49
    Hey Kye, don't you know that threads can have a life of their own beyond the original intention!? smile.gif

    Sometimes it takes a simple question to get some matter out on the table for further discussion. Phil's little chip is cheap and small and so I may just use his idea for some circuits that might have problems. For 11 cents or whatever I'll put it in anyway.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • DavidMDavidM Posts: 630
    edited 2009-10-12 23:45
    Hi,

    I think you are talking about the same issue I spoke about some time ago, I have made a small PCB to solve this issue ( at least for me) , essentially its a prop plug with additional circuitry ( an analog switch) for the reset line. refer to schematic.

    This device works for me, I can plug & unplug the USB Cable without the PROP Resetting. ( once activated)
    I can send data via serial/usb to a MAC or PC
    I can program the PROP as normal.

    The only catch is you need another I/O pin to ENABLE /DISABLE programming ( i.e resetting)

    By default my PCB acts as a normal prop plug, to take advantage of the new feature you need to set the I/O pin to disable programming via CODE.

    So if you wish to re-program you need something in your prop device/app ( menu selection,button ect) to allow the user to ENABLE/DISABLE PROGRAMMING.

    I have use a IP67/68 rated USB Connector for panel mounting and a micro-match connector for attaching to the main PROP Board.

    As I said. This works for me.

    regards

    Dave M
    1588 x 1316 - 187K
    1428 x 1082 - 131K
    1858 x 1310 - 239K
  • DavidMDavidM Posts: 630
    edited 2009-10-20 23:48
    Hi,

    So does anyone have any comments about my USB PCB or schematic? Excuse the upside-down pics

    As I said it solve the re-setting issue for me.

    Thanks

    Dave M
  • BitsBits Posts: 414
    edited 2012-04-17 09:41
    Phil, others

    Would another 74LVC2G07 need to be used when implementing the "rts" and "cts" pins on the FTDI ic?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-04-17 09:59
    Bits wrote:
    Would another 74LVC2G07 need to be used when implementing the "rts" and "cts" pins on the FTDI ic?

    That would be my recommendation, yes.

    -Phil
  • pedwardpedward Posts: 1,642
    edited 2012-04-17 11:50
    Hey Phil, what about putting a schottky diode between VCCIO and VCC of the FT232? In most circuits the VCCIO is connected to 3v3, which powers the Prop. If you put a feedback diode from VCCIO to VCC, VCC will get power off VCCIO and power the chip from 3v3.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-04-17 12:11
    pedward wrote:
    In most circuits the VCCIO is connected to 3v3, which powers the Prop.
    No, that's not the usual case. In most circuits, VCCIO is derived from the FT232R's internal 3.3V regulator and is used to power only the FT232R's I/O circuitry.

    -Phil
  • pedwardpedward Posts: 1,642
    edited 2012-04-17 15:18
    Well, that's true for the Proto and Quickstart, however I chose to use the internal regulator in the FT232RL to power the PropKey (it's rated for 50ma), we'll see how it works. This is something that *can* change in most systems to power the FT232 from 3v3 if no USB power is present. According to the datasheet this is totally fine for the FT232.
  • Dave HeinDave Hein Posts: 6,347
    edited 2012-04-17 15:53
    So a program that is intended to run on any Prop board should avoid starting a serial port on pins 31 & 30 if it's not connected to a computer, correct? Otherwise, it will continually reboot on some boards. Is there a list of boards that have this "feature"?
  • pedwardpedward Posts: 1,642
    edited 2012-04-17 16:25
    I know the quickstart DOES NOT have this mis-feature.
  • jazzedjazzed Posts: 11,803
    edited 2012-04-17 16:47
    pedward wrote: »
    I know the quickstart DOES NOT have this mis-feature.

    True. It has that other mis-feature.
Sign In or Register to comment.