USB flash drives offer a convenient method for storing various types of information in a compact form. Also referred to as thumb drives and USB keys, these drives are well-suited for applications in data loggers and other projects based on microcontrollers. However, in order to access files on a flash drive, a microcontroller must be equipped with USB host hardware and file system support. Many microcontroller-based devices typically lack these components. The USBwiz chip from GHI Electronics addresses this limitation. With the USBwiz, nearly any microcontroller can read and write files on flash drives. The microcontroller interfaces with the USBwiz through an asynchronous serial (UART) port or an SPI or I2C port, all of which are supported by most microcontrollers. The USBwiz is capable of accessing USB hard drives and flash-memory cards, including MultimediaCards (MMCs) and Secure Digital (SD) Cards. This article will demonstrate how to utilize the USBwiz to create a file on a flash drive, write to the file, and read its contents. Additionally, it will explain how to control the USBwiz from a PC using a terminal utility or Visual Basic. Once functional code is established on the PC, it can be transferred to the microcontroller of choice. USB communication occurs between a host and a device. The host contains host-controller hardware and manages communications on the bus, while the device contains device-controller hardware and responds to the host's communications. Host hardware and associated code are generally more complex than those for devices. PCs contain host controllers, enabling them to communicate with USB devices, including flash drives. Most USB-supporting microcontrollers include device controllers. A microcontroller that aims to access flash drives or other USB devices must have an embedded host controller or utilize a separate chip for this purpose, which is where the USBwiz is beneficial. The USBwiz is a programmed Philips LPC2141 microcontroller based on a 16/32-bit ARM processor core. For USB communications, the chip connects to a Philips ISP1160 USB host controller. The USBwiz-OEM board comprises both chips, two USB connectors, a connector for an SD Card or MultiMediaCard, and a user interface that provides connections for powering and communicating with circuits. The user interface features a series of holes that accept an 18-pin SIP header (provided by the user). This header can be plugged into a breadboard or a mating receptacle or soldered directly onto a circuit board. GHI Electronics offers free USBwiz firmware that supports a command set for board communication, with all commands and responses formatted as ASCII text. A bootloader program facilitates the loading of firmware into the USBwiz from an SD Card or MultiMediaCard. While this article primarily focuses on communications with USB drives, the USBwiz can also interface with USB mice, certain printers, some modems/cell phones, and USB device controllers from FTDI. The USBwiz is particularly suited for microcontroller communications; however, connecting the device to a PC can simplify the process of testing and debugging code. Once the system is operational, the code can be transitioned to the selected microcontroller. To connect to a USB port on a PC, a DLP Designs DLP-USB232M USB Adapter Board was utilized, which is conveniently available in a dual in-line package (DIP). This circuit can be constructed on a breadboard: If the PC is equipped with an RS-232 serial port or a USB/RS-232 adapter, the DLP-USB232M can be substituted with a Maxim Semiconductor MAX233 or a similar chip that facilitates the conversion between asynchronous serial and RS-232 voltage levels. Each USBwiz command must be concluded with a CR code (ASCII 0Dh). Upon receiving a command followed by a CR, the USBwiz responds with a status code and another CR. A status code of "!00" signifies success. For specific commands, the USBwiz may provide additional information following the status code, or the sender may need to supply further details as outlined. Although Windows includes a terminal utility named Hyperterminal, its use with this application is not recommended.
The USBwiz chip serves as a bridge between microcontrollers and USB storage devices, enabling seamless integration of file handling capabilities into embedded systems. The architecture of the USBwiz includes a microcontroller that manages the USB host functionality, which is essential for establishing communication with USB devices. The Philips ISP1160 USB host controller, when paired with the LPC2141 microcontroller, provides the necessary interface to support various USB communications protocols.
The USBwiz-OEM board's design includes essential connectors for USB input/output, as well as for SD and MMC cards, allowing for versatile data storage options. The incorporation of a user interface with an 18-pin SIP header simplifies the integration process with existing electronic projects, facilitating easy prototyping and experimentation on breadboards or custom circuit boards.
The firmware provided by GHI Electronics is designed to be user-friendly, utilizing ASCII commands that can be easily interpreted and debugged. This command set allows for straightforward file management operations, such as creating, writing, and reading files on the connected USB flash drive. The ability to connect and control the USBwiz from a PC enhances the development experience, as developers can leverage the PC's resources to write and test their code efficiently before deploying it on a microcontroller.
In summary, the USBwiz chip is an effective solution for integrating USB storage capabilities into microcontroller-based projects, enabling developers to enhance their applications with robust data handling features. The combination of the LPC2141 microcontroller and the ISP1160 host controller creates a powerful platform for managing USB communications, making it an essential tool for modern embedded systems.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 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 USBwiz comes in. The USBwiz is a programmed Philips LPC2141 microcontroller based on a 16/32-bit ARM processor core. For USB communications, the chip interfaces to a Philips ISP1160 USB host controller. The USBwiz-OEM board contains both chips, two USB connectors, a connector for an SD Card or MultiMediaCard, and a user interface that brings out connections for powering and communicating with the circuits. The user interface is a line of holes that accepts an 18-pin SIP header (which you provide). You can plug the header into a breadboard or mating receptacle or solder the header directly to a circuit board.
GHI Electronics provides free USBwiz firmware that supports a command set for communicating with the board. All commands and responses are ASCII text. A bootloader program loads the firmware into the USBwiz from an SD Card or MultiMediaCard. This article focuses on communications with USB drives. The USBwiz can also talk with USB mice, some printers, some modems/cell phones, and USB device controllers from FTDI.
The USBwiz is ideal for microcontroller communications, but sometimes the easiest way to check out a new device is to hook it up to a PC and use its resources to run and debug code. When you have everything working, you can port the code to your microcontroller of choice. To interface the port to a USB port on a PC, I used a DLP Designs DLP-USB232M USB Adapter Board, which comes in a handy dual in-line package (DIP).
You can build this circuit on a breadboard: If your PC has an RS-232 serial port or a USB/RS-232 adapter, you can replace the DLP-USB232M with a Maxim Semiconductor MAX233 or similar chip that converts between async. serial and RS-232 voltages. Every USBwiz command must be followed by a CR code (ASCII 0Dh). After receiving a command and CR, the USBwiz returns a status code followed by a CR. A code of "!00" indicates success. For some commands, the USBwiz follows the status code with additional information, or the sender of the command sends additional information as described below.
Windows includes a terminal utility called Hyperterminal, but I don`t recommend using it with 🔗 External reference
The camera flashlight circuit activates when switch K1 is engaged. This triggers a self-oscillating circuit consisting of BG1, capacitor C1, battery B1, and resistor R1. Once operational, the circuit boosts the voltage through B1 and rectifies it using diode...
This flasher activates only during nighttime, providing bright illumination and automatically turning off when sunlight is detected. The photocell should be positioned on top of the unit to maximize light detection.
The circuit for the nighttime flasher utilizes a photocell...
Communication with the MCP3028 ADC chip is achieved through a straightforward serial interface that adheres to the SPI protocol. The PIC16F84 or PIC16F628 does not possess a hardware SPI peripheral. However, a software-implemented SPI protocol can facilitate communication with...
This is a portable, high-power incandescent electric lamp flasher. It functions as a dual flasher (alternating blinker) capable of managing two independent 230V AC loads (bulbs L1 and L2). The circuit is entirely transistorized and operates on battery power....
Using a switch to power up your microcontroller projects may not be a good idea if you need to "wake" the PIC during some events. For example: A metal detector sends a pulse indicating a car is ready to...
The motor vehicle steering flasher described in the example utilizes high-power transistors as electronic switches, and the circuit is simple and easy to construct. The motor vehicle steering flasher consists of the flash circuit with resistors R1-R3, a capacitor...
We use cookies to enhance your experience, analyze traffic, and serve personalized ads.
By clicking "Accept", you agree to our use of cookies.
Learn more