Page 1 of 2

Mass Storage class over V-USB

Posted: Sun Oct 18, 2009 8:01 pm
by Saimon
I take this code to make my USB flash mass storage
http://depositfiles.com/files/00ar212ls

Re: Mass Storage class over V-USB

Posted: Sun Oct 18, 2009 8:02 pm
by saimon
Need help? Ask to me!

Re: Mass Storage class over V-USB

Posted: Sat Oct 24, 2009 11:07 pm
by christian
Has anybody tested this?

If it's indeed a mass storage implementation, I'd like to add it to our products section.

The download via depositfiles.com is a pain. Long time to wait and full screen ads in the background...

Re: Mass Storage class over V-USB

Posted: Mon Oct 26, 2009 5:01 pm
by Mr.bob
I've rehosted it in a few places.
I cannot test it myself (I'm not up to speed with Amtels yet) but hoping it might encourage people totry it :)

http://www.mediafire.com/?jezfi2jvwtz - less adverts, no timeout but tries to open a window. Diret link on page.

http://www.filedropper.com/massstoragemega8libusb - even less adverts but need to enter a captcha to download it.

Re: Mass Storage class over V-USB

Posted: Mon Oct 26, 2009 6:11 pm
by ulao
I would love to test this and have a use for it, but have no clue what r90 files are? If it was in C like all other projects I could have test it.

Re: Mass Storage class over V-USB

Posted: Mon Oct 26, 2009 9:12 pm
by Saimon
This project for IAR compiler. It can be configured by IAR Project manager. And one more: I use my own config for mega8. You can try to use standart IAR config for mega8

Re: Mass Storage class over V-USB

Posted: Tue Oct 27, 2009 1:55 am
by maxi
I am interested in this too and have ported what I think are the necessary bits to avr-gcc and got it to compile with AVR Studio. Unfortunately I don't have a mega8, I do have a mega88 but when I try to compile for that I get an error that GICR is not defined. I'm sure its not insurmountable but for now, if any one else wants to try, I uploaded the files here:

http://www.mediafire.com/?sharekey=cf77db0c8a33b7be6b21be4093fab7ac416059da76f2e19df0a154af670496da

If you try it then do please let me know how it goes.

Re: Mass Storage class over V-USB

Posted: Tue Oct 27, 2009 2:09 am
by Grendel
On the 88 the GICR bits have moved to EIMSK (INT1, INT0) and MCUCR (IVSEL, IVCE).

Re: Mass Storage class over V-USB

Posted: Tue Oct 27, 2009 4:56 pm
by ulao
a few bits have moved see the 88 migration pdf for more info.

I download your file and it compiles on the 88 and the 8. Neither run ( usb error ) but my guess is that its not pinned the same way my usb test board is. Was not sure where the schematic is.. I use pd1 and 2 for usb.

Re: Mass Storage class over V-USB

Posted: Tue Oct 27, 2009 5:16 pm
by maxi
Looking at the code I think the basic setup is D+ on INT1 (Pin 5), D- on INT0 (Pin 4). There also appears to be two LED's, Green on PC2 (Pin 25) and Red on PC3 (Pin 26) Both seem to be active low.
I now see what needs changed for mega88 compilation (Thanks Grendel) I will try it myself later when I have more time.

Re: Mass Storage class over V-USB

Posted: Wed Oct 28, 2009 12:32 am
by maxi
Ok, I have built up a test rig with my mega88. When I first plugged it in things seemed quite promising, the device was recognised as a usb mass-storage device but fails when trying to install the driver. That was Vista so I thought I might have more luck with XP however my old desktop doesn't recognise it at all.

<edit>If it's any help the error is Code 10, device cannot start.</edit>

There could be many things to blame; breadboard construction, mega8-88 conversion, gcc adaptation, using a 12meg xtal instead of 16 (all I got) or a million other things.

I'd still encourage others to give it a shot as I am little more than a beginner at this stuff. I'd be interested to hear if anyone ever gets it to work.

Re: Mass Storage class over V-USB

Posted: Wed Oct 28, 2009 9:45 am
by Saimon
Hi to all. I can show my screeshots and photos of my USB mass storage device. If anyone intresting please, emal me: lleeloo@mail.ru
If anyone has some question by my porject USB mass storage, you may mail me too. Best regards. Saimon

Re: Mass Storage class over V-USB

Posted: Wed Oct 28, 2009 11:59 am
by christian
This can't work on Vista because it uses bulk endpoints. You need a patch in a similar way as for AVR-CDC.

BTW: Why don't you host the project on our wiki at http://vusb.wikidot.com/hosted-projects ?

Re: Mass Storage class over V-USB

Posted: Wed Oct 28, 2009 9:18 pm
by maxi
Just a quick update, I found a slight mistake on my breadboard setup. Basically I had the pull-up resistor on the wrong side of the series resistor.
Still the same under Vista (though this has been explained) but now my XP box correctly identifies the device and it shows up in 'My Computer' as an external drive. Only thing now is that the drive is not formatted and any attempt to do so results in an error. Perhaps more code is required however this is still all a little over my head right now, but many thanks Saimon for sharing this.

Re: Mass Storage class over V-USB

Posted: Thu Oct 29, 2009 7:35 pm
by Saimon
I glad to be usefull! Maxi, error after formating beacouse no data is controlling. It only a full mass storage bulk interface with commands wraping and answering. I working on normal flash card, and i think 5 or 7 days i share my project to all! If anyone test my code and find some problems or errors or have some ideas, please, mail me: lleeloo@mail.ru. Sorry for my English!