Shop OBEX P1 Docs P2 Docs Learn Events
Microchip MCP2200 — Parallax Forums

Microchip MCP2200

Has anyone used Microchip's USB/UART bridge to program a Propeller? It doesn't include a DTR pin, but RTS is there, and the prop tool seems to allow either pin to be used. What have I overlooked?

http://ww1.microchip.com/downloads/en/DeviceDoc/22228A.pdf

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2016-08-22 22:24
    Needs a crystal circuit plus its speed is limited to <1Mbaud. The buffer is also only 128 bytes vs 512 elsewhere. Looks like a preprogrammed PIC chip (PIC18F14K50) but certainly a much cheaper alternative at $1.65 vs $3.65 for the FT232RL.
  • jmgjmg Posts: 15,173
    edited 2016-08-22 22:39
    JohnC wrote: »
    Has anyone used Microchip's USB/UART bridge to program a Propeller? It doesn't include a DTR pin, but RTS is there, and the prop tool seems to allow either pin to be used. What have I overlooked?

    Is this known to be working - did you connect a terminal and confirm Echo on loop-back, and toggle of RTS ?

    As Peter mentions, not the ideal choice for a new design.

    Best mid-level USB-UART looks to be the new CP2102N, as cheap as $1.16/1k, and no Xtal needed.
    Upgrades include 3MBd, Flash (re) Config, and a usable 3v3 regulator.
    Derived from the EFM8UB1, so you can change to that if you need high volume customize.
  • Thanks for your thoughts.

    JMG, I just noticed the checkbox in the prop tool preferences pane. Haven't tested it myself, and we've only ever sourced legit FTDI parts and used DTR. But I'm bothered by their driver / counterfeit part issues the last year or two, and also trying to shave the BOM where possible.

    Digikey sells a $14 development board for the Microchip part. I'm going to bring in a couple and see what happens.
  • jmgjmg Posts: 15,173
    edited 2016-08-22 22:58
    JohnC wrote: »
    ... and also trying to shave the BOM where possible.

    Digikey sells a $14 development board for the Microchip part. I'm going to bring in a couple and see what happens.

    If you want to shave the BOM, why choose a higher priced part, that also needs a crystal ?
    Order a CP2102N-EK from Digikey at the same time, and try that....

  • Heater.Heater. Posts: 21,230
    Turned out that FTDI's driver that bricked systems was more of a worry that the copy cat parts.

    I'm staying away from malware vendors as much as possible.
  • The CP2102N is really cheap and small, although I always worry about the very low levels of Silab stock that Mouser/Digikey stock, if at all.

    There is no advantage to using the MCP2200 since it needs a crystal plus caps and this costs more and takes up more pcb real estate. Many times I have seen the crystal dwarf the IC it supports.
  • Heater. wrote: »
    Turned out that FTDI's driver that bricked systems was more of a worry that the copy cat parts.

    I'm staying away from malware vendors as much as possible.

    A coworker bought some counterfeit cables via Amazon, and they didn't work well under Linux. I believe that the issue was the lack of a unique id per chip. And we needed to use two cables per system. This was not the fault of FTDI's driver, it was the counterfeit chips. I do know that FTDI windows drivers try to identify counterfeit chips and malfunction.

    Have you heard of a case where FTDI's driver caused problems with legitimate FTDI chips?
  • Heater.Heater. Posts: 21,230
    edited 2016-08-23 21:37
    I'm sure counterfeit chips can cause problems.

    No, I don't know of any problems with genuine chips and FTDI drivers.

    However it is unacceptable that a company can push software onto my computer that intentionally breaks my otherwise working system. This is malware, like the worst virus or trojan.

    This is a gross abuse of the Windows driver certification and update system.

    I think what is really annoying is that the humble serial port has been a part of computing since the beginning of time. About the simplest interface one could have. When all those "legacy" ports that were obsoleted by USB the serial interface should have been baked into the USB specification that replaced it.

    There should not even be any need for FTDI drivers.

  • Heater. wrote: »
    I think what is really annoying is that the humble serial port has been a part of computing since the beginning of time. About the simplest interface one could have. When all those "legacy" ports were obsoleted by USB the serial interface should have been baked into the USB specification that replaced it.

    There should not even be any need for FTDI drivers.

    You do dream big don't you? I like your dream world though... it sounds nice.
  • Heater.Heater. Posts: 21,230
    It was not a dream, big or small. It was real I tell you. It was nice. Or did I imagine it all? Like I imagined the composite video interface or VGA?

    Just now I'm reading that Apple wants to do away with the headphone jack. Soon that will become a dream as well I guess...

  • Would we expect Parallax to fully support counterfeit or cloned basic stamps or propellers? It sounds like your frustration is that you had some counterfeit chips in your possession, and then FTDI silently broke them after you had been using them for a while. I think that the only issue I would have is that FTDI should have had the driver fail in an obvious way that indicates that the chip in question is not legitimate. I don't think that they are morally bound to support counterfeit chips. And as far as I can tell such usage violates their license agreement, so perhaps there is a legal reason why it's in their best interest to take action when they are able. Was this FTDI driver update distributed via Windows update which requires user approval? And not done as sneakily as Windows 10?

    I've used various types of these chips from different vendors and they all have their quirks. When we were using CP210x parts a few years ago I believe that FTDI could support higher baud rates. Maybe this has changed, but that could be a technical reason to choose FTDI. (And their headquarters is in Glasgow which has got to count for something.)

    Counterfeiting is a large problem, so I expect that we'll see a similar scenario play out elsewhere. I know that there's work being done on secure chip odometers both for counterfeit detection and other purposes.
  • If I recall, they didn't just make the client fail to connect to the FTDI chip, the also rendered the counterfit FTDI chip busted. That I take issue with.
  • jmgjmg Posts: 15,173
    KeithE wrote: »
    I've used various types of these chips from different vendors and they all have their quirks. When we were using CP210x parts a few years ago I believe that FTDI could support higher baud rates. Maybe this has changed, but that could be a technical reason to choose FTDI.

    For a while, FTDI were the leaders, but that changes...

    * If you wanted High Speed USB to Serial, FTDI was the only game in town.
    I think there are now faster HS USB UARTS from EXAR - XR2280x offer a faster 15MBd speed, and a fractional Baud control.

    * SiLabs have some CP210x that need no added drivers, and their new CP2102N fixes some quirks.
    Some of the older CP210x were OTP, and their sustained speed was less than FTDI.
    The CP2102N is based on their 48MHz EFM8UB1, and is lower cost and Flash based and claims 3MBd Duplex.

    * Fastest FS UART is from EXAR

    * Dual UARTS in available smaller packages from SiLabs and Cypress, with Cypress CY7C6521x parts able to do not just UART, but also SPI and I2C.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2016-08-24 23:55
    @jmg - the XR2280x certainly looks interesting but it is much more than a UART with the emphasis on Ethernet really. The XR21V1410IL16-F though is a single UART in a tiny QFN16 package with data rates up to 12Mbps although the throughput would be much less I would say. I may just use this part in my next design plus it fully supports XON/XOFF flow control in the chip with immediate (not buffered) response. I will upgrade my Tachyon drivers to support XON/XOFF now as previously it was useless as the these control characters had to wait in deep FIFOs just like any other character.

    1606 x 1642 - 201K
  • I may just use this part in my next design plus it fully supports XON/XOFF flow control in the chip with immediate (not buffered) response. I will upgrade my Tachyon drivers to support XON/XOFF now as previously it was useless as the these control characters had to wait in deep FIFOs just like any other character.

    Peter - that's nice. I worked on GNSS chips for quite a few years and besides TCXOs & antennas, serial comms (UART & I2C) was the one thing that caused the most trouble at customers. I think that Silicon Labs has supported this for years - e.g. CP2103.

    I guess for embedded designs such as smartphones we can generally assume that XON/XOFF characters aren't lost or corrupted. But what if this isn't always the case? When we added this feature in GNSS hardware I put in various features in the the hope that they would enable recovery. One example is what if an XON character is lost or corrupted. Should the device that sent the XON resend based on the serial channel being idle for too long, or should the device that received the XOFF automatically reenable after a timeout? Both? Is this so rare that you end up resetting a subsystem in the event of a hang?

    Obviously for an interactive terminal session the user would just hit ^S or ^Q if the terminal wasn't behaving as expected.

    I looked at this data sheet and it didn't appear to address this sort of thing. For us this turned out to be a checklist item, and everyone used nCTS/nRTS for flow control. So much pressure to add 2-wire support just to get past the gatekeepers.
  • In regards to XON/XOFF flow control I've always built in extras by having an XON in any system prompt and extra XOFFs as the buffer continues to fill above the trigger depth. But if we can "lose" these characters which are just a minute fraction of the character stream then we have some real problems which have nothing to do with flow control anyway. I am mainly interested in short PC to Prop connections and in this regard I haven't had any problems yet. One of the advantages of using XON/XOFF effectively is mainly for downloading source code into Tachyon so that I can avoid fixed line delays and go as fast as the system allows.

    However the whole lockup problem with lost XON/XOFF could have been easily resolved by having a non-buffered enq control character continually sent during these periods asking for XON status. With this in mind it doesn't seem that it would be a problem if my system continually sent XON characters while the buffer was empty, as long as these characters are always handled by the hardware as soon as the character is received rather than buffered then there shouldn't be any problem. I guess I can always try this out.
  • jmgjmg Posts: 15,173
    @jmg - the XR2280x certainly looks interesting but it is much more than a UART with the emphasis on Ethernet really.

    Sure, but the prices mean you do not have to connect the Ethernet part :)

    The XR21V1410IL16-F though is a single UART in a tiny QFN16 package with data rates up to 12Mbps although the throughput would be much less I would say.

    The XR21x parts can sustain quite close to 12M - something above 9MBd of average equivalent data in one direction is possible on the tests I've done. (ie pretty much the whole USB bandwidth)

    I did uncover a bug in their drivers, where they crashed on large files of ~500k Bytes.
    Not sure if they fixed it yet ?
    ... plus it fully supports XON/XOFF flow control in the chip with immediate (not buffered) response. I will upgrade my Tachyon drivers to support XON/XOFF now as previously it was useless as the
    The CP2102N data mentions XON/XOFF, and I think they are locally done via FIFO watermarks.
    (as are the Hardware handshake lines)

    You can set the XON/XOFF chars used, in the Flash config.
    Could be worth testing that ?


  • jmg wrote: »
    The CP2102N data mentions XON/XOFF, and I think they are locally done via FIFO watermarks.
    (as are the Hardware handshake lines)

    You can set the XON/XOFF chars used, in the Flash config.
    Could be worth testing that ?

    I will get some of my dual row Prop plug style adaptors made with both the CP2102N and the XR21x parts to test them out.


  • Peter - I think you would most likely be ok, and you can easily make changes if there are problems down the line. It's when you're committing to somewhat inflexible hardware that will ship in volume that you need to be really careful. In your case it's probably always the Tachyon side that needs to hold off the host right? So like you said whenever you're over a threshold and see an incoming byte you send another XOFF. And if you ever do have problems there should be any harm sending XON characters every now and then as a sort of keep alive.

    As you say, whenever bytes are dropped it's usually a sign of something really wrong which should be addressed directly. You know how it is with the large ARM based systems though. People are often running reference designs (e.g Infineon/Intel or Qualcomm) and they have no idea where to look for the serial driver. If it weren't for good apps engineers nothing would work.
  • KeithE wrote: »
    Would we expect Parallax to fully support counterfeit or cloned basic stamps or propellers? It sounds like your frustration is that you had some counterfeit chips in your possession, and then FTDI silently broke them after you had been using them for a while. I think that the only issue I would have is that FTDI should have had the driver fail in an obvious way that indicates that the chip in question is not legitimate. I don't think that they are morally bound to support counterfeit chips. And as far as I can tell such usage violates their license agreement, so perhaps there is a legal reason why it's in their best interest to take action when they are able. Was this FTDI driver update distributed via Windows update which requires user approval? And not done as sneakily as Windows 10?

    I've used various types of these chips from different vendors and they all have their quirks. When we were using CP210x parts a few years ago I believe that FTDI could support higher baud rates. Maybe this has changed, but that could be a technical reason to choose FTDI. (And their headquarters is in Glasgow which has got to count for something.)

    Counterfeiting is a large problem, so I expect that we'll see a similar scenario play out elsewhere. I know that there's work being done on secure chip odometers both for counterfeit detection and other purposes.
    I agree, and this happened with prior versions. In the latest release the silently jam the communication. Many times you buy the chip and/or cable without knowing it is counterfeit. It happened to me with usb-rs232 converter cable bought in regular, well-known pc accessories store. I suspect neither they was aware of this.
    Now what can happen if this product is part of an industrial automation system and/or health-care supporting device? What happen if this device, at once, after an update, receives wrong data from the PC and thus alter its functioning? I think that in both cases industrial automation and health there is human life/injury involved.
    Regardless of user approval or not you can legitimately not support counterfeit products, but not silently alter its functioning thus risking to produce material and physical damages.
Sign In or Register to comment.