Author Topic: Looking for high speed USB memory stick or SDHC reading solution  (Read 17444 times)

0 Members and 1 Guest are viewing this topic.

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12105
  • Country: gb
    • Mike's Electric Stuff
All I want to do is be able to read data from a file and throw it out of either multiple UARTS, fast SPIs or 8 bit parallel, into an FPGA at rates of 1-4Mbytes/sec continuous (i.e. need enough extra speed & RAM buffering to cover any filesystem latency).

I've used the PIC24F parts with USB host and SD, which work fine as far as they go but the fundamental speed of the interface is a limiting factor. (as well as, at least in the case of SD, inefficient code, but this is fairly easy to tweak for a 2-3x efficiency gain)

Does any one know of any MCU that satisfies the following :

USB 2.0 high speed or SDHC port, and working free example code to read from a memory device, which can be compiled with a free or low-cost toolchain. (Ideally IAR EWB kickstart edition)

Not BGA, and readily available in small qty (10s). Onboard Phy would be nice.

Not under Linux - just power up & go. It will not be doing anything else - just reading a file and streaming it out so don't want the baggage and learning curve of an OS

NXP LPC1800 looks a possibility with their nxpUSBlib library but not clear if their USB library supports hi-speed.  This post indicates that there are some major performance issues  at the moment
http://www.lpcware.com/content/forum/mass-storage-readwrite-performance-lpc18xx
At least non-BGA packages appear to be becoming more available now.

Bare metal code on a RasPi may be an option if I can get the data out somehow - maybe parallel via IO pins - not looked in detail yet - does anyone know if there is a file system avaialabe yet for  bare-metal users?

This looked promising but speed is limited by the slow interface to the host, and the 4MBytes/sec speeds claimed turn out to only be useful for card-card copying.
http://www.ghielectronics.com/catalog/product/340
I think this is based on a ST ARM Cortex M3 chip.
If they had a way to, for example read USB and spit it out of the 4-bit SPI interface, under control of the UART port that could be ideal.

Something that can be got up & running easily with minimal learning curve is highest priority - parts cost not a major issue.

Just wondering if anyone else has looked into this before I start digging any further..
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1119
  • Country: fi
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #1 on: January 27, 2013, 01:54:48 pm »
Have you looked at Freescale's Kinetis series? At least some of the bigger parts claim to support all of SDHC, USB HS and external bus interfaces. Never used them myself, so can't comment on any of that.

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 18929
  • Country: nl
    • NCT Developments
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #2 on: January 27, 2013, 01:56:58 pm »
Maybe the the person is using the LPC1800 wrong. AFAIK the speed of the USB connection is set by a resistor to the data lines. If he got that wrong the USB connection is not hi-speed. And there are two ways of sending packets over a USB connection. One method is for messaging, the other for bulk data.

For your purpose you could probably use an USB to SPI chip like thise one http://www.ftdichip.com/Products/ICs/FT232H.htm to convert the data stream on the USB bus to an SPI interface.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online firewalker

  • Super Contributor
  • ***
  • Posts: 2357
  • Country: gr
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #3 on: January 27, 2013, 02:04:11 pm »
For your purpose you could probably use an USB to SPI chip like thise one http://www.ftdichip.com/Products/ICs/FT232H.htm to convert the data stream on the USB bus to an SPI interface.

Is this chip able to read file system on a usb device connected?

I believe Maxim has some ready to go SPI to USB mass storage chips. Don't know how fast it is.

Alexander.
« Last Edit: January 27, 2013, 02:07:09 pm by firewalker »
Become a realist, stay a dreamer.

 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12105
  • Country: gb
    • Mike's Electric Stuff
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #4 on: January 27, 2013, 04:24:06 pm »
Maybe the the person is using the LPC1800 wrong. AFAIK the speed of the USB connection is set by a resistor to the data lines. If he got that wrong the USB connection is not hi-speed. And there are two ways of sending packets over a USB connection. One method is for messaging, the other for bulk data.

For your purpose you could probably use an USB to SPI chip like thise one http://www.ftdichip.com/Products/ICs/FT232H.htm to convert the data stream on the USB bus to an SPI interface.
No - I need USB Host, not device.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12105
  • Country: gb
    • Mike's Electric Stuff
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #5 on: January 27, 2013, 04:25:37 pm »
The issue is not so much speed (once the basic interface is running High Speed) but something with a software solution that works & that I can tweak for my needs without having a huge learning curve for USB etc.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Online firewalker

  • Super Contributor
  • ***
  • Posts: 2357
  • Country: gr
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #6 on: January 27, 2013, 04:32:40 pm »
Something like the device bellow, or I got all wrong?

http://tinyurl.com/aypqpaa

Alexander.
Become a realist, stay a dreamer.

 

Online enz

  • Regular Contributor
  • *
  • Posts: 112
  • Country: de
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #7 on: January 27, 2013, 04:36:34 pm »
How about the Vinculum chip from FTDI?
http://www.ftdichip.com/Products/ICs/VNC2.htm

It's a programmable USB-Host and available as DIP-Modules:
http://www.ftdichip.com/Products/Modules/DevelopmentModules.htm#V2DIP1

I have no experience with this product, but maybe it can do what you are looking for?

Martin
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 7337
  • Country: us
    • SiliconValleyGarage
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #8 on: January 27, 2013, 04:58:47 pm »
I would go with the vinculum as well. It can even handle the filesystem. Look at vinculum 2 in special.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1119
  • Country: fi
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #9 on: January 27, 2013, 05:03:41 pm »
Neither Vinculum support high-speed though. The FT313H does, but looks like you have to run the USB stack externally.

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12105
  • Country: gb
    • Mike's Electric Stuff
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #10 on: January 27, 2013, 05:16:22 pm »
I would go with the vinculum as well. It can even handle the filesystem. Look at vinculum 2 in special.
The VNC2 would be exactly what I need IF it were high speed, but it isn't.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12105
  • Country: gb
    • Mike's Electric Stuff
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #11 on: January 27, 2013, 05:17:29 pm »
Something like the device bellow, or I got all wrong?

http://tinyurl.com/aypqpaa

Alexander.
Nope. Not high speed and needs a SW stack on a seperate MCU.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline djsb

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: gb
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #12 on: January 27, 2013, 05:46:46 pm »
What about the Chipkit Max32?

http://ww1.microchip.com/downloads/en/DeviceDoc/chipKIT%20Max32_rm.pdf

Just a stab in the dark.

David.
David
Hertfordshire,UK
 University Electronics Technician, London PIC,CCS C,Arduino,Kicad, Altium Designer,LPKF S103,S62 Operator, Electronics instructor.  http://debuggingrules.com/ Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1119
  • Country: fi
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #13 on: January 27, 2013, 07:27:17 pm »
What about the Chipkit Max32?
Doesn't support high-speed USB or SD cards.

Offline Marco

  • Super Contributor
  • ***
  • Posts: 4625
  • Country: nl
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #14 on: January 27, 2013, 08:01:10 pm »
Have you looked at Freescale's Kinetis series? At least some of the bigger parts claim to support all of SDHC, USB HS and external bus interfaces. Never used them myself, so can't comment on any of that.
Unless you want to port the stack to GCC you will need Codewarrior for this BTW.
 

Offline marshallh

  • Supporter
  • ****
  • Posts: 1462
  • Country: us
    • retroactive
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #15 on: January 27, 2013, 08:05:01 pm »
Take a look at
http://www.digikey.com/product-detail/en/LPC4320FBD144,551/568-9449-ND/2840461



I solved this problem by having an fpga with custom SD controller do block DMA transfers to sdram. An external CPU woudl read the filesystem and find the longest span of contigous file sectors, then load the sector range in the FPGA where hardware dma was performed.
10mb/sec capped.
Verilog tips
BGA soldering intro

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

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12105
  • Country: gb
    • Mike's Electric Stuff
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #16 on: January 27, 2013, 08:07:53 pm »
What about the Chipkit Max32?

http://ww1.microchip.com/downloads/en/DeviceDoc/chipKIT%20Max32_rm.pdf

Just a stab in the dark.

David.
Not high speed. "USB 2.0 Full Speed" just means plain old USB.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12105
  • Country: gb
    • Mike's Electric Stuff
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #17 on: January 27, 2013, 08:11:40 pm »
Take a look at
http://www.digikey.com/product-detail/en/LPC4320FBD144,551/568-9449-ND/2840461



I solved this problem by having an fpga with custom SD controller do block DMA transfers to sdram. An external CPU woudl read the filesystem and find the longest span of contigous file sectors, then load the sector range in the FPGA where hardware dma was performed.
10mb/sec capped.
Was this SD in SPI mode or full 4-bit? Documentation on the latter appears scarce as you need to join the SD card club to get it.
This may be a viable approach, even just  doing it a sector at a time.
But it's frustrating that there are several MCUs out there that should be able to do it all, it just needs the software stack to be there. 
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Online firewalker

  • Super Contributor
  • ***
  • Posts: 2357
  • Country: gr
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #18 on: January 27, 2013, 08:14:40 pm »
The SPI bus on an SD card what speed can offer?

Alexander.
Become a realist, stay a dreamer.

 

Offline marshallh

  • Supporter
  • ****
  • Posts: 1462
  • Country: us
    • retroactive
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #19 on: January 27, 2013, 08:20:29 pm »
You can get ~2-3 mbyte/sec through SPI. But, there is sufficient info in the SD simplified spec to implement 4bit mode. I sat down with a printout of the spec and had it working in 3 days, only sticking point was the separate rolling crc16 on each data line, but here you go

Code: [Select]
crc16_3 <= {crc16_3[14:0], 1'b0} ^ ((pin_dat_out[3] ^ crc16_3[15]) ? 16'h1021 : 16'h0);
crc16_2 <= {crc16_2[14:0], 1'b0} ^ ((pin_dat_out[2] ^ crc16_2[15]) ? 16'h1021 : 16'h0);
crc16_1 <= {crc16_1[14:0], 1'b0} ^ ((pin_dat_out[1] ^ crc16_1[15]) ? 16'h1021 : 16'h0);
crc16_0 <= {crc16_0[14:0], 1'b0} ^ ((pin_dat_out[0] ^ crc16_0[15]) ? 16'h1021 : 16'h0);
Verilog tips
BGA soldering intro

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

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12105
  • Country: gb
    • Mike's Electric Stuff
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #20 on: January 27, 2013, 08:32:43 pm »
The SPI bus on an SD card what speed can offer?

Alexander.
Not sure what the max speed is in single SPI mode , which is essentially MMC card emulation. The MMC spec says 20MHz - it could be that the more recent SD cards may inherit a bit more speed from the SD hardware.
The above post on FPGA gives me an idea of how I could get a lot more speed using my existing SD card code in simple SPI mode. I know when the filesystem library is reading data from my file (because I've already hacked the code a lot it to speed it up!) ,  so I could externally mux the SPI bus with a CPLD or FPGA so when I know the file data read is happening, the external logic clocks the card as fast as possible and catches the data, the PIC host being oblivious to the data transfer.




Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Online firewalker

  • Super Contributor
  • ***
  • Posts: 2357
  • Country: gr
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #21 on: January 27, 2013, 08:37:43 pm »
The non GNU/Linux requirement is because you just don't want to fiddle with it?

Alexander.
Become a realist, stay a dreamer.

 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 18929
  • Country: nl
    • NCT Developments
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #22 on: January 27, 2013, 08:41:21 pm »
The SPI bus on an SD card what speed can offer?

Alexander.
Not sure what the max speed is in single SPI mode , which is essentially MMC card emulation. The MMC spec says 20MHz - it could be that the more recent SD cards may inherit a bit more speed from the SD hardware.
The above post on FPGA gives me an idea of how I could get a lot more speed using my existing SD card code in simple SPI mode. I know when the filesystem library is reading data from my file (because I've already hacked the code a lot it to speed it up!) ,  so I could externally mux the SPI bus with a CPLD or FPGA so when I know the file data read is happening, the external logic clocks the card as fast as possible and catches the data, the PIC host being oblivious to the data transfer.

Just to get things clear: you want to use a USB stick OR an SD-ish card to store a file and dump it into an FPGA?
If yes: Some microcontrollers in the LPC2000 series from NXP have a dedicated SDHC interface. It can do 4 bit transfers. With this FAT filesystem http://elm-chan.org/fsw/ff/00index_e.html you can have the SDHC part up & running real quick (it has drivers for the LPC2300). To transfer the data into the FPGA you can use SPI and DMA. IMHO SDHC is a much easier route than USB host.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 12105
  • Country: gb
    • Mike's Electric Stuff
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #23 on: January 27, 2013, 08:49:08 pm »
The non GNU/Linux requirement is because you just don't want to fiddle with it?

Alexander.
A few reasons - Mainly I don't want to learn Linux for what should be a simple job, I want it to start quickly on powerup, I need a guaranteed data flow rate, so can't have any unpredictable latency issues. I also don't want to have to burn unnecessary power/cycles on things that aren't needed.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Online firewalker

  • Super Contributor
  • ***
  • Posts: 2357
  • Country: gr
Re: Looking for high speed USB memory stick or SDHC reading solution
« Reply #24 on: January 27, 2013, 08:55:30 pm »
The non GNU/Linux requirement is because you just don't want to fiddle with it?

Alexander.
A few reasons - Mainly I don't want to learn Linux for what should be a simple job, I want it to start quickly on powerup, I need a guaranteed data flow rate, so can't have any unpredictable latency issues. I also don't want to have to burn unnecessary power/cycles on things that aren't needed.

Ohhh, that's easy! Just download the source code of the real time Linux kernel (Wind River Systems) play with it for couple of years to customize it and you are done!

 :-DD :-DD :-DD :-DD :-DD

Alexander.
Become a realist, stay a dreamer.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf