Need help to start with USB

I need to read/write sectors on USB flash memory mass storage. (I hope this is the correct title)

AFAIK, this has two requirements:

  1. hardware: USB connection.
  2. software: handshaking with USB devices.

I think/hope that (1) will be easily solved with AT89C5131.

That leaves me with number 2: Is the protocol freely available? What is the protocol's name, ie. what am I searching for?

Again, I want to read/write sectors.

Reply to
aleksa
Loading thread data ...

According to the data sheet here:

formatting link

This device (like most) is a USB slave only.

You need a USB Master to talk to a USB slave. This device can be programmed to be a slave only.

USB master code is much more complicated, and costs real money.

Look for micro-controller with a USB master, then look for the cost of master code.

good luck

don

Reply to
don

documents/doc4136.pdf

I didn't even know there are master/slave devices. Where did you, exactly, read in the doc4136.pdf that the device is slave only?

Actually, I wanted to connect a USB memory stick to atmel's micro, then the micro to the PC to avoid learning how to work with PC's hardware.

Maybe is easier to work with PC's hardware? No windows, only BIOS.

Reply to
aleksa

here:

formatting link

The data sheet does not say its a host device, so its not.

You have some more homework to do before you can just drop in code and have it work.

Start here:

formatting link

If you just want to read/write USB sticks, use this and save a lot of headache.

formatting link

don

Reply to
don

With respect - I think your understanding of USB needs to be improved before you tackle this project. I would recommend reading the following as a starting point:

formatting link

--
Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers.  More than 7000 downloads per month.

+ http://www.SafeRTOS.com
Certified by TÜV as meeting the requirements for safety related systems.
Reply to
FreeRTOS.org

aleksa schrieb:

Do you have a VERY GOOD reason for this? I'm asking because ...

- USB itself is rather complex, the standard itself has some 1000 pages to read and to understand

- USB hosts (and you want do make an USB host since the USB stick is a device) are a magnitude more complex especially in software than USB devices.

Your AT89C5131 has only got an USB device interface. For USB host you need something bigger, eg. an ARM9. For writing a complete USB base and mass storage host from scratch you will need at least half a year, most probably more.

My advice:

  1. Try to redefine your problem. It is MUCH easier to read and write mmc/sd cards from the microcontroller, even for small ones. You can plug the sd cards into readers and use them as USB sticks then. If you choose micro sd cards the USB card readers even have the shape of an USB stick.

  1. Get a microcontroller system with a capable os on it, eg. ARM7/ARM9 with Linux. Linux gives you a complete, tested USB host stack.

--
Mit freundlichen Grüßen

Frank-Christian Krügel
Reply to
Frank-Christian Krügel

formatting link
is another way of doing it.

Cheers Don...

--
Don McKenzie

Site Map:            http://www.dontronics.com/sitemap
E-Mail Contact Page: http://www.dontronics.com/email
Web Camera Page:     http://www.dontronics.com/webcam
No More Damn Spam:   http://www.wizard-of-oz.com

http://www.dontronics-shop.com/super4-usb-relay-module.html
Reply to
Don McKenzie

Hi Aleksa,

I think (like others) that You are underestimating what You want to achieve, USB is quite a PITA and Your replies show that Your knowledge is still very limited in this field. That is off course not a problem, You have to start on a subject at the beginning, just be prepared that it will not be a thing You will make on a rainy sunday afternoon. The controller You want to use is not capable of what You want to achieve. I would recommend You to get an Atmel USB-key, it's a very cheap demoboard with an AT90USB1287 controller that will allow You to talk to a slave (I am still working with it as a slave itself but with an adaptercable it can be used as a master, You can e.g. also connect a USB mouse to it). Link:

formatting link
You might start reading the documentation and demoprograms that can be downloaded from Atmel to get an idea of what is involved.

Another option might be, if it is possible for Your situation off course, writing to a CF-card that You can read back in a computer using a cheap cardreader. The interface to such a thing is much simpler. But maybe this is not possible at all and besides, with the stuff that comes with the USBkey it might just be not that difficult to implement Your own idea.

Wishing You lot's of good luck and joy, Rene

Reply to
Rene

First of all, thanks everyone for your replies.

I am currently looking into MAX3421E and hoping that the guy at

formatting link
knows what he is doing.

Don mentioned ghielectronics: it's promising, cheap, 16$, but goes to 70$ with shipping.. plus a lot of people (as I read it quickly) has problems with it.

Richard, thanks for the usb-in-a-nutshell link! As it turns out, I already had it in my favorites, but who can find it there..

As for the card readers... not sure, yet.

I got a headache just by looking into a list of links I have to visit.

Reply to
aleksa

I too have used this part.

It does work, if you have the time to debug it.

I hope you don't think you can just copy somebodies code, re-compile and have it work.

I get the feeling you are a beginner with visions of being a hero.

Good Luck, you're going to need it.

don

Reply to
don

The question was more to what your application needs. If your device is copying from one USB stick to a another, the CF or SD solutions of course don't apply. OTOH, if you're looking at data acquisition, for example, SD cards are dead simple (relatively speaking) to integrate.

As things go, having a myriad of choices is a nice "problem" to have.

Reply to
MikeWhy

You don't need to go up quite that far. Some of the PIC24 chips can act as a USB host; Microchip's USB SDK includes a demo program for logging to a USB thumb drive.

Reply to
Nobody

In the november 2008 issue of Elektor there was an article about the new Vinculum chip from FTDi. It is a usb host controller.

formatting link

S.

Reply to
Stefan Arentz

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.