Forums

Solutions for DSP to PC transfer?

Started by David Bonnell March 30, 2007
This is slightly OT, but I figured I would ask anyway.

I'm looking for a way to transfer data from a DSP to a file on a PC.
Are there any simple solutions or off-the-shelf products available for
this sort of thing?  Ideally I'd like to either stream data or do a
block transfer into a file on the PC.

I'm using a TI DSP with several available communication options
(McBSP, SPI, USB, MMC, I2C, UART, JTAG).

Cheers,
Dave

> I'm looking for a way to transfer data from a DSP to a file on a PC. > Are there any simple solutions or off-the-shelf products available for > this sort of thing? Ideally I'd like to either stream data or do a > block transfer into a file on the PC. >
I've since discovered that the term for this is "datalogging", and have been searching for relevant information. Still, any (constructive) advice on the subject is appreciated!

David Bonnell wrote:

>>I'm looking for a way to transfer data from a DSP to a file on a PC. >>Are there any simple solutions or off-the-shelf products available for >>this sort of thing? Ideally I'd like to either stream data or do a >>block transfer into a file on the PC. >> > > I've since discovered that the term for this is "datalogging", and > have been searching for relevant information. Still, any > (constructive) advice on the subject is appreciated!
The easiest is UART; it takes minimum of programming and no extra hardware. All other ways require the advanced knowledge and/or special hardware arrangements. If your goal is to get something for quick and cheap, use UART. The USB is good, but it is fairly complicated. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
"David Bonnell" <dbonnell@gmail.com> writes:

> This is slightly OT, but I figured I would ask anyway. > > I'm looking for a way to transfer data from a DSP to a file on a PC. > Are there any simple solutions or off-the-shelf products available for > this sort of thing? Ideally I'd like to either stream data or do a > block transfer into a file on the PC. > > I'm using a TI DSP with several available communication options > (McBSP, SPI, USB, MMC, I2C, UART, JTAG).
I think the easiest way is to do direct file I/O within your DSP application, using, e.g., the C language fopen(), fwrite(), etc. This is assuming that you don't have to transfer large amounts of data real-time. Of course it also assumes that you can run your code with the debugger/PC hooked up to your target system. -- % Randy Yates % "She's sweet on Wagner-I think she'd die for Beethoven. %% Fuquay-Varina, NC % She love the way Puccini lays down a tune, and %%% 919-577-9882 % Verdi's always creepin' from her room." %%%% <yates@ieee.org> % "Rockaria", *A New World Record*, ELO http://home.earthlink.net/~yatescr
What kind of DSP board do you have ?

If it's TMS320C6713 DSK used for prototyping a project, then there is
a third-party Host Port Interface daughtercard from Educational DSP
( http://www.educationaldsp.com/stockproduct_dsk6xxxhpi.htm )


On Mar 30, 2:36 pm, "David Bonnell" <dbonn...@gmail.com> wrote:
> This is slightly OT, but I figured I would ask anyway. > > I'm looking for a way to transfer data from a DSP to a file on a PC. > Are there any simple solutions or off-the-shelf products available for > this sort of thing? Ideally I'd like to either stream data or do a > block transfer into a file on the PC. > > I'm using a TI DSP with several available communication options > (McBSP, SPI, USB, MMC, I2C, UART, JTAG). > > Cheers, > Dave
> The easiest is UART; it takes minimum of programming and no extra > hardware. All other ways require the advanced knowledge and/or special > hardware arrangements. If your goal is to get something for quick and > cheap, use UART. The USB is good, but it is fairly complicated.
UART is a bit slow. I actually used it on the previous generation of my project, but I'm looking to transfer about 80 kB. At maximum RS-232 speed that's still about 7 seconds. Of course, the full algorithm needs to keep running during the transfer, so such a sweep could take minutes depending on CPU load. I'm still considering UART, but something that can do the job faster would be very attractive. RS-232 ports are becoming difficult to find, particularly on laptops. I was just looking for other potential options that I wasn't aware of (I'm new to this after all). In particular, a solution that could write directly to file on a PC (or flash drive). Cheers, Dave
> I think the easiest way is to do direct file I/O within your DSP > application, using, e.g., the C language fopen(), fwrite(), etc. This > is assuming that you don't have to transfer large amounts of data > real-time. Of course it also assumes that you can run your code with > the debugger/PC hooked up to your target system.
Good point Randy. I should have mentioned that I am using a JTAG emulator for in-house development/testing, so I do have access to all relevant data (more or less in real-time). I do not need to transfer large amounts of data in real-time. Streaming data would be lovely (works out to about 2 bytes every 3 microseconds!), but isn't a requirement. What type of link are you talking about when you mention fopen(), etc.? Wouldn't the DSP need to have knowledge of the PC's file system? Go easy, I'm still new to this!
On Apr 2, 8:30 am, "David Bonnell" <dbonn...@gmail.com> wrote:
> > The easiest is UART; it takes minimum of programming and no extra > > hardware. All other ways require the advanced knowledge and/or special > > hardware arrangements. If your goal is to get something for quick and > > cheap, use UART. The USB is good, but it is fairly complicated. > > UART is a bit slow. I actually used it on the previous generation of > my project, but I'm looking to transfer about 80 kB. At maximum > RS-232 speed that's still about 7 seconds. Of course, the full > algorithm needs to keep running during the transfer, so such a sweep > could take minutes depending on CPU load. > > I'm still considering UART, but something that can do the job faster > would be very attractive. RS-232 ports are becoming difficult to > find, particularly on laptops. I was just looking for other potential > options that I wasn't aware of (I'm new to this after all). In > particular, a solution that could write directly to file on a PC (or > flash drive). > > Cheers, > Dave
RS232 to USB converters are available (I'm looking right now at model USB-2920 from www.cablesunlimited.com and they bump the baud rates to 600k. I've already written a handler to log all bytestreams coming in on a comm port for a PC, and with Code Composer v3.3 and my TI320 I can write to the Uart device with fopen, printf statements. Thats the CHAD solution. I also have a Firewire connection on my DSP, and a flash card reader, If I can figure out how to use it, I should be able to write the file to it, and then read the card.

David Bonnell wrote:

>>The easiest is UART; it takes minimum of programming and no extra >>hardware. All other ways require the advanced knowledge and/or special >>hardware arrangements. If your goal is to get something for quick and >>cheap, use UART. The USB is good, but it is fairly complicated. > > > UART is a bit slow. I actually used it on the previous generation of > my project, but I'm looking to transfer about 80 kB. At maximum > RS-232 speed that's still about 7 seconds.
This is true. However most of the modern PC comports support for the bitrates higher then 115k. The speed bottleneck is the RS232 level convertor, but usually you can run up to 230k without any problems.
> Of course, the full > algorithm needs to keep running during the transfer, so such a sweep > could take minutes depending on CPU load.
???? The RS232 transfer is a miser. It should not be affected by the CPU load.
> I'm still considering UART, but something that can do the job faster > would be very attractive.
It is mainly the question of how deep do you want to be involved. My preference is the Ethernet, and it is not too simple either.
> RS-232 ports are becoming difficult to > find, particularly on laptops.
The USB to RS232 convertors work just fine. I was just looking for other potential
> options that I wasn't aware of (I'm new to this after all). In > particular, a solution that could write directly to file on a PC (or > flash drive).
You can either write to the compact flash or to the USB junk drive. Either variant is not very simple from the programming prospective. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
"David Bonnell" <dbonnell@gmail.com> writes:

>> I think the easiest way is to do direct file I/O within your DSP >> application, using, e.g., the C language fopen(), fwrite(), etc. This >> is assuming that you don't have to transfer large amounts of data >> real-time. Of course it also assumes that you can run your code with >> the debugger/PC hooked up to your target system. > > Good point Randy. I should have mentioned that I am using a JTAG > emulator for in-house development/testing, so I do have access to all > relevant data (more or less in real-time).
Then you should have all you need.
> I do not need to transfer large amounts of data in real-time. > Streaming data would be lovely (works out to about 2 bytes every 3 > microseconds!), but isn't a requirement. What type of link are you > talking about when you mention fopen(), etc.? Wouldn't the DSP need > to have knowledge of the PC's file system? Go easy, I'm still new to > this!
You use fopen() on the DSP just as if it were running on the PC. I believe the default directory is the one CCS was started up in. Oh yeah. Did I tell you that you have to run your code from CCS? That is, you have to start up CCS and then run your program inside of CCS. Somehow the file IO uses the jtag interface - don't ask me how, it's magic to me. I've used this technique many times (e.g., for running test vectors files stored on the PC through an algorithm) and it works beautifully, albeit a little slowly. -- % Randy Yates % "How's life on earth? %% Fuquay-Varina, NC % ... What is it worth?" %%% 919-577-9882 % 'Mission (A World Record)', %%%% <yates@ieee.org> % *A New World Record*, ELO http://home.earthlink.net/~yatescr