Shop OBEX P1 Docs P2 Docs Learn Events
Serial data transfer speeds FTDI vs RS232 — Parallax Forums

Serial data transfer speeds FTDI vs RS232

CarlosFandangoCarlosFandango Posts: 67
edited 2008-11-26 11:14 in Propeller 1
Dear All,

I have been working on an application with the Prop (actually the uOLED-96-Prop) and up until now I've been using a simple RS232 serial interface - the 3-transistor circuit detailed on the Parallax site. Part of my application requires that I can upload files via serial to the micro SD on the uOLED; I wrote a fairly simple routine for doing this with checksum support and over the RS232 link this transfers at about 32k bits/sec using a serial speed of 57k/sec. With overheads etc., I guess this is quite reasonable.

However, since I have to distribute this application and most computers do not have RS232 ports these days, I today implemented a USB serial cable using the FTDI chip. Using the drivers from the FTDI site, my transfer speeds have now dropped to a mere 7kbits/sec (the serial port comms speed remains unchanged at 57k). Uploading revised firmware from Proptool, however, seems to take about the same amount of time as it did before - there has been no impact there.

Thus I am somewhat confused; I wondered if anyone has experienced such slowdowns using FTDI chips or drivers, and if so, whether a solution was found? I've checked all system / port settings etc., but can't find anything amiss anywhere. I continue in the meantime to try and improve my transfer speeds...

thanking you

-CF

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2008-11-24 14:06
    I use the FTDI 2232 chip with no problems at 115,200 baud. I wonder if you have some kind of block setting in the driver???
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-11-24 15:44
    Hmm, don't know - I've looked as deeply as I can into this and fiddled with various settings, but the RS232 is consistently faster for some reason. I prefer to believe that it's my code that's at fault; but that doesn't explain the speed difference really. Which leads me right back to an FTDI issue... you can see where I am with this!

    I can't run at 115K it seems, there's not enough time (in SPIN anyway) to get around everything without dropping data. Programming the prop works fine at this speed, it's just my file transfer routine I'm talking about here. Having said that I'm just about to move to a 10MHz version of the uOLED (earlier ones that I've been working with are 8MHz) and that gives me top speed on the prop which I haven't seen before. I wondered why they used an 8MHz crystal on the early devices, probably just an oversight on their part!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-11-24 15:49
    Did you say you’re trying to do this high-speed interface using the transistor driver circuit? Even RS-232 driver chips have bandwidth limitations and I would be willing to bet this is your biggest bottleneck.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-11-24 15:59
    Hi Chris - yes, I am using a transistor circuit, or I was at least. However it is this that is giving me better performance at the moment, and not the FTDI device. After some messing around today I have been able to get my transfer speed back up to 42kbits using the FTDI, with a 56K serial port setting, I doubt I will do much better than this - so possibly this issue is solved for the most part...? In any event, all computers are set up differently, and so on - it's obvious that the USB/FTDI connection should be better, overall wink.gif
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-11-24 16:14
    Okay, I think I missed something…how exactly are you connecting the FTDI based solution? Are you using our Prop Plug? I would expect the transistor serial circuit to perform less optimally than the FTDI interface, depending on the connections.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-11-24 18:01
    I'm actually using the FTDI cable TTL-232R-3V3-WE with an added transistor / capacitor on the RTS line and the current limiting resistors on the TX and RX lines.... I agree with you though, performance should be better with this, and in fact the firmware update process seems to be just as swift as it was previously.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-11-24 18:32
    Actually your problems are now making sense…I would expect diminished performance with this configuration. You don’t want an RS-232 adapter since you’re not talking to an RS-232 device. By adding the resistors on the RX/TX lines you’re affecting the bandwidth negatively. You should be using the Prop Plug or USB2SER so that the signals don’t have to be further converted.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-11-24 18:45
    Sorry if I sound stupid Chris, I do quite often - but the circuit I'm using is as far as I can tell exactly equivalent to a prop plug? That's the schematic I used, anyway. I do have a prop plug as it happens, although I've never used it (which is a shame because it cost me 60 bucks!). The prop plug is a bit of a non starter as this is intended to be a commercial device - the FTDI cables are much cheaper...
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-11-24 21:05
    Carlos,

    Check the settings for the FTDI adapter in your Windows Control Panel. You may have the latency set to a high value. If so, change it to 1, and see if your throughput improves.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Just a few PropSTICK Kit bare PCBs left!
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-11-24 21:22
    Hi Phil, thanks for the tip - the latency was set at 16ms. I've changed it to 1 as you suggest and the transfer speed has improved, slightly - however I should say that working through the day I have gotten the FTDI interface up from 7kbits to 38kbits, with the latency reduced, this has gone up to 42kbits/sec. That's almost as good as I could expect I guess! Now I have to work out why the darned thing keeps resetting (even when the cable isn't plugged in - it's a completely different issue that one!)

    -CF
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-11-24 22:19
    I thought you had our USB to 232 adapter, which is set up for RS-232 signals…I had to look up their cable since the name implies RS-232 output. In any event I see it has the signal lines directly brought out. So what size resistors do you have in series with the RX/TX pins?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-11-25 16:31
    Chris... They are specified as 150 ohms on the schematic but I have used what I had, which are 120 ohms. The schematic to which I am referring is attached (last page). Basically, I am using the schematic to modify the FTDI cable to match (notwithstanding the fact that I am using RTS and not DTR for reset - DTR ain't available) - I am supposing that the resistors aren't totally necessary, but are there for current limiting purposes? Sometimes it seems these are specified, and other times they are not. I would have thought that with a 3V3 cable they wouldn't be needed but I'm not sure, so am playing safe. I'd very much like to be given the lowdown on this!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-11-25 16:52
    You are correct, the resistors are there for safety (current limiting) especially when connecting to a 5V signal. In any event, if you’re sure the resistors are the correct value and not actually significantly higher, then I have no explanation for the reduced speed. You may have to contact them directly in this case.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-11-25 20:17
    Yes sure Chris, thanks for the assistance anyway. It might be moot now in any case; I am getting speeds (after tinkering, especially with the PC side) of about 42kbits/sec - that's pretty good for a sustained rate over a 56K connection.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-11-25 20:21
    And yet you should be able to get at least 240K if both sides support it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-11-26 09:29
    That's true, and something I am working towards!
  • BTXBTX Posts: 674
    edited 2008-11-26 11:14
    Hi Carlos.

    Sorry, how are you wiring the schematic ? Have you some picture of it assembly ?
    I guess you're using the correct USB cable from FTDI to PC...really?
    I´ve never have problems, neither working at 115Kbps. (homemade adapter).
    How long is the USB cable that you're using ?


    PS: Me imagino que no estaras usando el adaptador cerca de el puerto USB y luego llevando la señal RS232 por un cable largo hacia el propeller ...no?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
Sign In or Register to comment.