Need help communicating PIC18F2550 with a USB flash drive

Discussion in 'Embedded Systems and Microcontrollers' started by Lee Sin, Jun 3, 2015.

  1. Lee Sin

    Thread Starter New Member

    Jun 3, 2015
    3
    2
    First of all, I am a total newbie with the whole coding thing. I am trying to create a "talk box" which basically plays an audio file according to the buttons that are pressed.

    The requirements are :
    The system must have a sleep mode to conserve energy (watchdog timer seems like the best idea to me)
    The system must wake up from the sleep mode as fast as buttons are pressed
    The system must be able to read the audio file (.wav) off of the USB flash drive and plays the file

    So basically, I am stuck at the USB part. I have no idea how to make the PIC chip reads the file from the flash drive and play it. I have tried researching extensively but since I am a total newbie at this, nothing seems understandable to me. Any help will be appreciate.

    Thank you,
    Max
     
  2. Technetium

    New Member

    May 26, 2015
    4
    2
    absf likes this.
  3. Lee Sin

    Thread Starter New Member

    Jun 3, 2015
    3
    2
    I have read through those articles and was able to understood a bit of information. I know I might be asking for too much but if anyone could help me explain how the USB flash drive can communicate with the device step-by-step, I would be eternally grateful.
    Anyways, Thanks for your reply Technetium :D
     
  4. Technetium

    New Member

    May 26, 2015
    4
    2
    Your welcome, as you can see I'm a new member too, I am in an engineering shop in my high school, is this a project that you are doing(not part of a class or job)?
     
  5. Lee Sin

    Thread Starter New Member

    Jun 3, 2015
    3
    2
    It is a project that I need to do in order to graduate. So yes I am very desperate and trying everything I could including asking people on forums. :D
     
    ErnieM and Technetium like this.
  6. Technetium

    New Member

    May 26, 2015
    4
    2
    That's only a bit desperate,
     
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    Sorry but the PIC is not up to this job. The USB module inside it is a slave device, and so is a flash drive.

    So you need to pick a PIC that has hosting capabilities. I peeked at the Microchip Advanced Part Selector (search for MAPS) on the Microchip site) and came up with only PIC24, DS33, and PIC32 devices that can support a host.

    If you want to stay with a PIC18 then you may want to change to an SD card (as opposed to a USB flash drive) and these are supported by most any device with an SPI module which most PICs have.

    I'm also sorry I can no longer guide people thru the free code libraries and samples Microchip provides: they updated these things a couple of years back and I'm still sorting my way thru them (or using the previous version I used when I wrote the code I'm now using). But there is most probably good code to support you either way you go.

    Do try the Microchip forums, they are full of smart guys who are current on this stuff.
     
  8. Brian Griffin

    Member

    May 17, 2013
    40
    12
    This is not a straight-forward solution as USB drivers for flash drives can take a very large amount of space in a USB-host capable microcontroller. It can be very difficult, and you need custom chips to do that for you.

    You might need this: http://www.ebay.com/itm/USB-SD-U-di...245?pt=LH_DefaultDomain_0&hash=item25a63ab125 and connect this to your microcontroller.

    Or, by using an SD-Card - there are many examples about playing wave files online using a microcontroller.
     
  9. DickCappels

    Moderator

    Aug 21, 2008
    2,648
    632
  10. John P

    AAC Fanatic!

    Oct 14, 2008
    1,632
    224
    Could you possibly change this from a USB memory stick to an SD card? That would change the level of difficulty from "just about impossible" to "pretty challenging" though I'm afraid either of those is a poor choice for a "total newbie with the whole coding thing". The school that you're graduating from shouldn't be expecting a beginning programmer to do this kind of project alone.
     
Loading...