how to read and write on USB flash drives

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
neechan18
Posts: 40
Joined: 26 Jul 2010 22:22

how to read and write on USB flash drives

#1 Post by neechan18 » 28 Jul 2010 02:31

hi... :?: is there any mikroc program on how to read and write on USB flash drives?? everytime i search on the internet.. programs on how to read/write on SD/MMCs are only available... are they just the same??? i am using pic18f4455... pls. help me asap.. i just need it.. thanks... hope there are replies... thanks again

kada200
Posts: 56
Joined: 10 Jul 2010 08:04
Location: Phoenix, AZ

Re: how to read and write on USB flash drives

#2 Post by kada200 » 28 Jul 2010 04:26

I share in your dilemma neechan, as I see alot of stuff people are doing with SD/MMC, but I too would like to know more info on using a USB for things like a mass storgage device with the PIC or for like using it like a 'mini HD' for the PIC, or data logging etc. I only have a few months of MikroC Pro/EasyPIC5/16F887 behind me, and learn a bit more each day, but this topic in question is definitely an area I have wanted to explore in much greater detail for some project ideas i have of my own. I realize my 16F887 wont support it-maybe I will go ahead and purchase a 18F4550 after I finish this post just to get things rolling on my end.

You might want to take a few minutes registering on edaboard.com-they have alot of useful info and on their site is a interesting post titled "My experiments with PIC18F4550 USB"
http://www.edaboard.com/ftopic313796.html
be sure to read thru all the posts(about 3 pages) cause i think he made a mistake that was revealed in his hardware connections. Also check out the extra links/.zip and .rar files posted as they offer some insight. One link takes you to sourceforge.net where you can view the .tar file of a project code that seems to be a read/write program that you might be able to adapt/get ideas from:
http://pic18fusb.sourceforge.net/

Interesting video on what one guy has done with laptop and PIC/USB:
http://www.youtube.com/watch?v=tNxBJbia ... re=related

Hope this helps.

*Note to ADMINS* I hope that posting the above links doesn't violate any board rules-I tried viewing FAQ's and such to see if I was in the wrong but didnt find anything contrary to it. Plz correct me if I am wrong.
#DEFINE ENDEAVOR_TO_PERSERVERE 1
While (ENDEAVOR_TO_PERSERVERE != 1) {
ENDEAVOR_TO_PERSERVERE = 1;
}

Phoenix, AZ (USA)

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: how to read and write on USB flash drives

#3 Post by Dany » 28 Jul 2010 07:33

neechan18 wrote:hi... :?: is there any mikroc program on how to read and write on USB flash drives?? everytime i search on the internet.. programs on how to read/write on SD/MMCs are only available... are they just the same??? i am using pic18f4455... pls. help me asap.. i just need it.. thanks... hope there are replies... thanks again
Hi,
To be able to do this you need an USB host library for the PIC, capable of handling the USB CDC stuff. As far as I know mE does not deliver that kind of library. :?
Additionally you will need Fat16 or Fat32 software (made to work with the USB library) to access the files on the stick.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

neechan18
Posts: 40
Joined: 26 Jul 2010 22:22

Re: how to read and write on USB flash drives

#4 Post by neechan18 » 28 Jul 2010 13:13

thanks for your reply kada200 and Dany...
i appreciate all your help.

i hope i could figure out how to....
:!:

neechan18
Posts: 40
Joined: 26 Jul 2010 22:22

Re: how to read and write on USB flash drives

#5 Post by neechan18 » 28 Jul 2010 13:19

hmmm.. i need more replies.. :(

User avatar
slavisa.zlatanovic
mikroElektronika team
Posts: 1321
Joined: 07 Apr 2009 09:39

Re: how to read and write on USB flash drives

#6 Post by slavisa.zlatanovic » 28 Jul 2010 14:15

Hi neechan18!

I just want to inform you that it is in our plans to develop the USB Host/OTG Library.
Note that only PIC32 MCUs support the USB Host feature.
PIC24 USB chips (24FJxxxGBxxx) support OTG and can also be used to handle the USB Flash drive.
Your PIC18F4455 can only serve as USB device and you can't use it to handle USB Flash drive.

Best regards
Slavisa
Best regards
Slavisa

Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Re: how to read and write on USB flash drives

#7 Post by Dany » 22 Oct 2012 10:03

Hi, there is an MSD Host library now (for mP anyway): see http://www.libstock.com/projects/view/4 ... st-library.
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)

Post Reply

Return to “mikroC PRO for PIC General”