Access Flash Drives with a Microcontroller

Posted on Feb 6, 2014

USB flash drives provide a handy way to store any type of information in a small package. The drives, also known as thumb drives and USB keys, seem ideal for use in data loggers and other microcontroller-based projects. But to access files in a flash drive, a microcontroller must have USB host hardware and support for a file system. Microcontroller-based

Access Flash Drives with a Microcontroller
Click here to download the full size of the above Circuit.

devices often lack these elements. To the rescue is the USBwiz chip from GHI Electronics. With the USBwiz, just about any microcontroller can read and write to files in flash drives. The microcontroller can access the USBwiz via an asynchronous serial (UART) port or an SPI or I2C port. Most microcontrollers support one or more of these ports. The USBwiz can also access USB hard drives and flash-memory cards such as MultimediaCards (MMCs) and Secure Digital (SD) Cards. In this article, I`ll show how to use the USBwiz to create a file in a flash drive, write to the file, and read the file`s contents. I`ll also show how to control the USBwiz from a PC using a terminal utility or Visual Basic. When you have working code on the PC, you can port the code to your microcontroller of choice. Every USB communication is between a host and a device. The host contains host-controller hardware and manages communications on the bus. The device contains device-controller hardware and responds to communications from the host. Host hardware and code are more complex than device hardware and code. PCs contain host controllers and thus can communicate with USB devices, including flash drives. Most microcontrollers with USB support contain device controllers. A microcontroller that wants to access flash drives or other USB devices must have a host controller embedded in the microcontroller or accessed on a separate chip. This is where the...

Leave Comment

characters left:

Related Circuits

  • New Circuits



    Popular Circuits

    Reset Protection For Computers
    18W Audio Amplifier Circuit
    AM portable Reciever Using ZN414
    Adjustable regulator using L200
    Low Noise Microphone Preamplifier Circuit
    Transformerless 5 Volt Power Supply circuit
    On-off Infrared Remote Control
    The Follow-Me Rover robot circuit
    A common collector amplifier
    Heart rate detection circuit diagrams