Author Topic: Capturing high speed serial data stream on pc  (Read 6272 times)

0 Members and 1 Guest are viewing this topic.

Offline miscjunkTopic starter

  • Contributor
  • Posts: 19
Capturing high speed serial data stream on pc
« on: July 26, 2014, 08:02:04 pm »
I have a high speed control application using the F28335. My control loops are operating at 20kHz. I would like to stream various measurements in real-time to a PC for post processing and analysis, and even real-time graphing/monitoring. I've done some calculations and figured I need anywhere from 200kbytes/sec (minimum) to 800+kbytes/sec (desired). I have an ft232h on board, but it's serial data transfer is limited to 921kbps - while I need between 2mbps and 8mbps.

What are some options for logging data at such high speeds? Peripheral wise, I have access to UART, USART, and SPI (with the F28335 being a master). I figure there must be some usb 2.0 or 3.0 peripheral out there which can capture high speed serial data to the PC.

I've pre-ordered a couple Saleae Logic Pro 16s, and in theory it looks like it should work. But, I'm looking for some other options. All of the USB SPI Slave devices I've found work only to 4mbps or so - however the effective bandwidth is significantly less, as they can't receive and log a constant stream.

Any ideas, or preferable something that you've actually used?
 

Offline Smokey

  • Super Contributor
  • ***
  • Posts: 2923
  • Country: us
  • Not An Expert
Re: Capturing high speed serial data stream on pc
« Reply #1 on: July 26, 2014, 09:15:22 pm »
Wouldn't it be funny if two people working for the same company, in different divisions, that didn't know each other, were both posting to this form at the same time and inadvertently helped each other solve the same exact application problem......

On Friday an application came up for collecting SPI data (CHECK!) .... from a TI TMS320F2800 series DSP (close, if that's what you mean by F28335).... which has control loops running at 20khz (DING!).....   and dumping it to a PC for post processing and graphing (DING!).... I could totally be making that up (On the Internet, nobody knows you're a dog), but that would make me way more of a dick than I actually am in real life :)

Luckily I can miss some data, so I don't have to transmit everything but I still want to catch as much as I can.  My plan was to use a PIC18F4458 hooked up to the SPI bus as a master and dump the packets back to the PC using USB.  I think that will work, but the main reason for that specific chip is that I have already designed a little dev board around it so I have one at hand.  I haven't written any code specifically for this application yet (I know.. that's the hard part) but it should be interesting what rate I will actually be able to get. 
My project is of the "when you get to it" variety, so you will probably have something working before me.
I posted elsewhere on a software defined radio thread that I thought it would be cool to have a flexible Ethernet based solution to high speed data logging.  That would be a cool building block to have in the tool box.

If you can operate your logger(bridge) on the SPI bus as the master (I saw you you said the F28335 was currently the master) then something like these might work.  I haven't personally used any of these..
http://www.microchip.com/wwwproducts/Devices.aspx?product=MCP2210
http://www.silabs.com/products/interface/usbtouart/pages/usb-to-spi-bridge.aspx

This guy looks like it comes with software examples, but I can't find the data rate anywhere..
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KITUSBSPIDGLEVME
 

Offline cyr

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: se
Re: Capturing high speed serial data stream on pc
« Reply #2 on: July 26, 2014, 10:09:23 pm »
If the data is already on a SPI bus, or could be dumped there, I would suggest:

http://www.totalphase.com/products/beagle-i2cspi/

Maximum SPI speed is 24Mbps, although they have a disclaimer about continous streaming of data at that speed isn't guaranteed blablabla. 2-8Mbps should be no problem I *think*.
I myself have mainly used it for analyzing I2C traffic...

You can export captured data in binary or CSV format, or you use their API directly from a number of languages (something I have never tried).

http://www.totalphase.com/support/articles/200472426-Beagle-Protocol-Analyzer-User-Manual#s6.7
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13998
  • Country: gb
    • Mike's Electric Stuff
Re: Capturing high speed serial data stream on pc
« Reply #3 on: July 26, 2014, 10:21:40 pm »
I have an ft232h on board, but it's serial data transfer is limited to 921kbps -
No it isn't - FT232H devices can do up to 12MBaud in serial mode, and up to 40MBytes/sec in parallel mode
« Last Edit: July 26, 2014, 10:24:40 pm by mikeselectricstuff »
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline marshallh

  • Supporter
  • ****
  • Posts: 1462
  • Country: us
    • retroactive
Re: Capturing high speed serial data stream on pc
« Reply #4 on: July 27, 2014, 01:02:44 am »
Your ft232h is fine, you aren't using it properly. Read the datasheet again (you may have to use FTPROG to set mode options in the eeprom)
Verilog tips
BGA soldering intro

11:37 <@ktemkin> c4757p: marshall has transcended communications media
11:37 <@ktemkin> He speaks protocols directly.
 

Offline miscjunkTopic starter

  • Contributor
  • Posts: 19
Re: Capturing high speed serial data stream on pc
« Reply #5 on: July 27, 2014, 02:05:03 am »
Sorry, it's actually a FT2232D, and I only have access to Channel B (no mpsse).

I've used an FT232H before with libftdi as a usb to GPIO bridge. I'll see if I can squeeze one of those in there.

Thanks for the suggestion of the beagle protocol analyzer ... I've had one on order from total phase, and wanted to explore other options before it arrives.

I think I hear a vibrating trunk lid somewhere, gtg check it out.
 

Offline miscjunkTopic starter

  • Contributor
  • Posts: 19
Re: Capturing high speed serial data stream on pc
« Reply #6 on: July 27, 2014, 02:27:41 am »
Yep, the ft232/2232/4232H series does seem to be the ticket. Not sure if the standard virtual com port driver supports the full 10mbps ... May have to use the D2xx libraries and whip something up. Luckily, I think I have some ft232h eval boards lying around from my previous hackery (my autocorrect actually recognized that!) with them. Will check it out in the coming week.
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13998
  • Country: gb
    • Mike's Electric Stuff
Re: Capturing high speed serial data stream on pc
« Reply #7 on: July 27, 2014, 08:32:44 am »
Yep, the ft232/2232/4232H series does seem to be the ticket. Not sure if the standard virtual com port driver supports the full 10mbps ... May have to use the D2xx libraries and whip something up. Luckily, I think I have some ft232h eval boards lying around from my previous hackery (my autocorrect actually recognized that!) with them. Will check it out in the coming week.
VCOM does support nonstandard rates - I'm not sure of the details as I usually use D2xx, but in some windows apps you can set nonstandard rates directly.
There is also the option of tweaking the divider ratios in one of the .INF files to alias baudrates - there is an appnote about this.
  However if you have the choice, D2XX is the way to go as it gives you better control over stuff like latency timers, which can make a huge difference to achievable throughput.

Quote
Sorry, it's actually a FT2232D, and I only have access to Channel B (no mpsse).
Is the pinout close enough to replace it with a FT2232H? I think the 2232D will do up to 6Mbaud
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline miscjunkTopic starter

  • Contributor
  • Posts: 19
Re: Capturing high speed serial data stream on pc
« Reply #8 on: July 27, 2014, 09:26:13 am »
Ft2232d max baud rate is 3mb as noted in the data sheet.. I checked the vcp driver configuration, and only baud rates up to 921kbps were exposed...
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13998
  • Country: gb
    • Mike's Electric Stuff
Re: Capturing high speed serial data stream on pc
« Reply #9 on: July 27, 2014, 11:15:28 am »
Ft2232d max baud rate is 3mb as noted in the data sheet.. I checked the vcp driver configuration, and only baud rates up to 921kbps were exposed...
I know there is a way to get higher rates, but I'm not sufficiently familiar with windows serial API to know exactly how it works - I do know there are some windows apps that let you set wacky rates directly, and I don't think they have specific FTDI support. A customer of mine got this reply from FTDI a while ago when enquiring :
Quote
If you’re writing your own software, most standard COM port API calls will allow you actually specify the desired baud rate directly.  Some terminal programs also allow direct entry, such as TeraTerm.  This approach would allow you to use the standard drivers without any edits.

A problem with aliasing is that if you do it with the standard VID/PID, it can get overwritten by updates, so you need to reprogram the chip with a custom PID.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf