Capturing high speed serial data stream on pc - Page 1
Forum section: electronics / projects

author: miscjunk
author_rank: Contributor
timestamp: July 26, 2014, 08:02:04 pm
content: 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?

author: Smokey
author_rank: Super Contributor
timestamp: July 26, 2014, 09:15:22 pm
content: 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 lifeLuckily 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=MCP2210http://www.silabs.com/products/interface/usbtouart/pages/usb-to-spi-bridge.aspxThis 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

author: cyr
author_rank: Frequent Contributor
timestamp: July 26, 2014, 10:09:23 pm
content: 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

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: July 26, 2014, 10:21:40 pm
content: Quote from: miscjunk on July 26, 2014, 08:02:04 pmNo it isn't - FT232H devices can do up to 12MBaud in serial mode, and up to 40MBytes/sec in parallel mode

author: marshallh
author_rank: Unknown
timestamp: July 27, 2014, 01:02:44 am
content: 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)

author: miscjunk
author_rank: Contributor
timestamp: July 27, 2014, 02:05:03 am
content: 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.

author: miscjunk
author_rank: Contributor
timestamp: July 27, 2014, 02:27:41 am
content: 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.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: July 27, 2014, 08:32:44 am
content: Quote from: miscjunk on July 27, 2014, 02:27:41 amVCOM 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.QuoteIs the pinout close enough to replace it with a FT2232H? I think the 2232D will do up to 6Mbaud

author: miscjunk
author_rank: Contributor
timestamp: July 27, 2014, 09:26:13 am
content: 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...

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: July 27, 2014, 11:15:28 am
content: Quote from: miscjunk on July 27, 2014, 09:26:13 amI 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 :QuoteA 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.