portable usb storage device

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I'm trying to send a file from my PC to a dataflash through a USB controller (at43usb355). I want it to work like a portable USB storage device. I know i am gonna use USB to do it but I dunno how.

Is there somebody out there that knows how to do this? Or even where to starting looking?

Thanks
Edy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dataflashes would be too small. You would need a micro and either an i2C or SPI port to communicate with the Dataflash.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

my processor (AT43usb355) has SPI ports and I'm using that to communicate with my 2 megabyte flashcard. But what i'm having trouble with is getting the information from the PC onto the at43usb355 then onto my flashcard using SPI.

Edy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm not familiar wiht that particular chip, but I assume it's just a general AVR micro with a USB UART rather than serial.

What do you have trouble with? Can you send data to the chip and it's just putting on/reading from the flash that's troublesome?

What programming language do you use?

- Dean

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

abcminiuser wrote:
I'm not familiar wiht that particular chip, but I assume it's just a general AVR micro with a USB UART rather than serial.

What do you have trouble with? Can you send data to the chip and it's just putting on/reading from the flash that's troublesome?

What programming language do you use?

- Dean

ekchen want's to build a USB storage device and is looking for documentations how to set up USB for that. Have a look at usb.org. I think there should anywhere be a document describing how a storage device has to respond.

I can remember that Jesper build a Storage device with a FT245 for his MP3 Players.
Looking at http://www.yampp.com/ could help too.

Hava a look at my web page -> http://www.tobiscorner.at.tf

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If your device is going to emulate a USB flash stick, then it is a mass storage device. I am in the process of writing the other end of the software. We have an embedded device that uses a Cypress SL811HS acting as a host that will interface with the flash stick.

Personally, the usb.org mass storage specs were not quite good enough for me to understand all the crap that needed to be done. Since these devices needed to be accessable also by a PC, there needs to be a partition table and file system which just happens to be FAT. Microsoft has a description of FAT and found the partition table description by searching the web.

The flash stick that I'm testing with uses the transparent SCSI command set (subclass 6)but seems to be close enough to the UFI command set that usb.org has documented.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

im guessing that you want it to be recognized by windows explorer as a sepreate drive like the storage mediums are. to do this, you would have to write a driver for the chip that windows would be able to work with. ive seen it done before...but have not seen how.

i wish you luck

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When the USB FLASH is connected to the PC, it is already using Window's driver. But I also need to be able to read from and write to it using a ATmega162 and some PIC 18F series processors. The Cypress SL811HS chip is the USB interface for them. Got it working last night up to the point of reading/writing the actual FLASH. That should be a small step since I have got the SCSI transparent command set packets working now.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ekchen wrote:
Hi,

I'm trying to send a file from my PC to a dataflash through a USB controller (at43usb355). I want it to work like a portable USB storage device. I know i am gonna use USB to do it but I dunno how.

Is there somebody out there that knows how to do this? Or even where to starting looking?

Thanks
Edy

Hi Edy,

I started to work with at43usb355. Could you share your experience.
Is there any specific forum for this device ?
Do you have the access to the ATMEL libraries source for at43usb355?
Are you Edy Gunawan?
My direct email skogan@sbcglobal.net

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BPar wrote:
When the USB FLASH is connected to the PC, it is already using Window's driver. But I also need to be able to read from and write to it using a ATmega162 and some PIC 18F series processors. The Cypress SL811HS chip is the USB interface for them. Got it working last night up to the point of reading/writing the actual FLASH. That should be a small step since I have got the SCSI transparent command set packets working now.

Hello,

could you please post your sourcecode? A working example would help a lot to get started with own projects using USB sticks.

Thanks,
micavr

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I cannot post my source code since it was for work. I have tried to write something that I could post but cannot find the time to finish it.

I am not sure what you are asking for. Is it code to interface with the Cypress SL811HS chip or SCSI transparent command data.

I found SL811HS.C file on Cypress' website once and that's what I based my interface on. It was written using Keil 8051 C compiler that stored mult-byte data MSB first instead of GCC's LSB first.

That code does have some problems/bugs in it. I cannot remember if the corrections were posted here or through PM.

The SCSI code is easy once you figure out what bytes go where. I believe I posted some USB tracker captures that showed the data between host controller and USB stick during enumeration and a couple of SCSI commands.

EDIT - fixed URL
http://www.avrfreaks.com/index.php?name=PNphpBB2&file=viewtopic&t=22424

Hope this helps. If not then let me know and I will try to bring those brain cells back to life.

Last Edited: Thu. Feb 16, 2006 - 09:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for your reply.

I think my main problem is initializing and interfacing the SL811HS chip.

As you already mentioned in the other thread, a simple step-by-step example (pseudo code) with information about the necessary initializations and handling of the different states would help a lot to be able to realize such projects.

Thanks,
micavr

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I might have already done this for somebody doing this in PIC assembly. IIRC, that still had a problem with reading data too slowly.

If I can find it and figure out the correction(s), I'll post it tonight.

Do not get your hope up for something simple. As I've stated before (at least in other threads), this was the hardest project I have ever done. Well, at least until I had to use and ActiveX control in a Windows service.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I gathered together some documentation.

In the .ZIP:
- host_811.h & host_811.c that seem to be the initial code that I based mine on.
- variables.txt is sort of pseudo-code/text description of the functions in host_811.c. It made sense to me at the time and the other person was able to get his working from it. This does not have the reading from device too slowly correction in it.
- sl811hs_appnote.pdf describes host_811 functions also. Probably a lot better than mine.

The host_811.c is written for the Keil C compiler for the 8051 and saves multiple byte data MSB first.

Here is my notes to things that got fixed to variables.txt. They no longer make any sense to me.
1. Don't toggle, use Data1 flag for zero writes. Moved into ACK, PID_OUT.
2. EP0_NAK retries - subtract Xfer from Pointer because of re-arming.
3. When arming for the next PID_IN inside the

if (!remainder && wLen)

section. It sets bit 5 of cmd which synchs data transmissions with SOF for full speed devices which is wrong. It should only sync for low speed devices.

I cannot what fixed the reading too slowly problem. I'll see if I can get access to the code that has it.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you very much, I will read and try to understand that documentation.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

for bPar. i can't open the .zip file after i download this file.????
can you send it to my e-mail at yoppie_cpl@yahoo.com
thank you