usb

Not rated 15,487

usb
usb

This document outlines a project completed by a team between September 2000 and March 2001 as part of the Engineering Physics degree program at the University of British Columbia. The project involved constructing a USB device utilizing the PIC 16C745 microprocessor from Microchip. The device included a microphone, the microprocessor, and additional hardware to transmit audio data to a host computer. This document contains notes, links, and code snippets related to USB, USB Human Interface Devices, the 16C745 microprocessor, and specific project details. The aim was to create a functional device, but the low sampling rate of the microprocessor during the analog-to-digital conversion distorted the audio signal, rendering it indecipherable on the host computer, although loud and soft transitions were detectable. USB (Universal Serial Bus) facilitates two-way communication between peripheral devices and host computers, allowing for hot plugging, which means devices can be connected or removed while the computer is operational. The USB specifications detail various features of the protocol, although they may not be practical for device or software development. USB devices can be categorized as high-speed or low-speed, with differences in type, length, and connectors. High-speed devices can transfer data at a maximum of 12 Mbps, while low-speed devices are limited to 1.5 Mbps. The PIC 16C745 operates only at the low-speed standard. The computer's connector (A end) is a flattened rectangle, while the device's connector (B end) is square with two cut-off corners, which is necessary for compliance with the high-speed standard but optional for low-speed devices. Each USB device can draw 100 mA from the cable, allowing for bus power, and can negotiate up to 500 mA once connected, though this power may not always be available. If unavailable, the device must remain in a low-power state, although external power is also an option. When a device is connected, the computer (or hub) detects it via a pull-up resistor (see circuit). A pull-up resistor on the D- wire indicates a low-speed device, while a high-speed device has a pull-up on the D+ wire. Upon detection, a series of enumeration steps commence. The enumeration process assigns an identifier to the device (with a maximum of 127 devices on a network) and informs the host computer about the device's capabilities (input, output, etc.). The device also provides the computer with its name (Vendor, Product, Version, and Serial Number). Human Interface Devices (HID) represent a class of USB devices that structure the data transferred between the device and the host computer. During enumeration, the device describes the information it can send and receive, allowing the host computer to manage incoming data without requiring a specialized device driver. The HID class includes devices such as mice, joysticks, and keyboards. Since the host computer understands the data format, a specific device driver is not necessary for HID devices, enabling the operating system to provide a generic HID driver. For example, when a USB mouse is connected, it functions immediately because the operating system recognizes how to interpret data from a mouse.

The project involved the design and implementation of a USB audio device, leveraging the capabilities of the PIC 16C745 microprocessor. The schematic for the device integrates several components, including the microphone for audio input, analog-to-digital converters (ADCs) for signal processing, and necessary passive components such as resistors and capacitors to ensure stable operation and signal integrity.

The microprocessor serves as the central processing unit, handling the digital signal processing and USB communication. The USB interface requires a specific configuration to ensure compliance with USB standards. This includes the implementation of a pull-up resistor on the D- line to indicate low-speed operation, as the PIC 16C745 is limited to this mode.

The device's power management is crucial, as it can draw power directly from the USB connection. This involves designing a power circuit that allows the device to operate efficiently within the 100 mA limit, with provisions for negotiating higher power requirements if necessary.

The software component of the project includes firmware for the microprocessor that manages audio data acquisition from the microphone, processes the data, and formats it for USB transmission. The host computer software is designed to receive and interpret the audio data, allowing for real-time processing and playback.

Overall, the project illustrates the integration of hardware and software in creating a functional USB audio device, highlighting the challenges faced in audio fidelity due to the limitations of the microprocessor's sampling rate. Further improvements could focus on enhancing the audio quality by utilizing higher-performance ADCs or alternative microcontrollers with better processing capabilities.This page describes a project a colleague and I completed between September, 2000 and March, 2001 as part of the Engineering Physics degree program at the University of British Columbia. In summary this project involved building a USB device using the PIC 16C745 microprocessor from Microchip.

The USB device consisted of a microphone, the microproc essor and other hardware and the device sent audio data to the host computer. This page contains notes, links and code extracts from this project relating to USB, USB Human Interface Devices, the 16C745 microprocessor, and specifics of this project. Hopefully this information will be helpful to your project. We achieved our goal and built a working device. This involved building the device hardware (microprocessor, microphone, and supporting electronics) and software (microprocessor code and host computer code).

Unfortunately, the relatively low sampling rate by the microprocessor in the analog-to-digital conversion process mangled the audio signal to make it indecipherable at the host computer, but loud/soft transitions were easily detected. USB (Universal Serial Bus) is a protocol that allows two way communication between peripheral devices and a host computer.

It is hot pluggable, allowing the device to be connected and/or removed while the computer is running. There are lots of other features of USB. The specifications for USB are available at. Be warned that while this information is very thorough, it is not very practical for developing a device or software.

Technical documents are available at. There are two types of USB devices: high speed and low speed. There are differences in the type, length and connectors that can be used with the two types. Generally the requirements are stricter for high speed devices. A high speed device can transfer data at a maximum of 12 Mbs while low speed is limited to 1. 5 Mbs. The PIC 16C745 can only operate at low speed standard. The connector at the computer (A End) is a flattened rectangle while at the device (B end) the connector is square with two cut-off corners (necessary to be compliant with the high-speed standard but optional for low speed devices). Each USB device is able to draw 100mA from the cable which allows a device to be bus powered. A device can negoiate up to 500mA once connected to the USB cable but this power may not be available.

If the power is unavailable the device must stay in a low power setting. Obviously devices can be powered externally as well. When a device is connected, the computer (or a hub) detects the device by a pullup resister (see circuit). A pullup resister on the D- wire signals a low speed device, while a high speed device has a pullup on the D+ wire.

When detected a series of enumeration steps are started. The enumeration process assigns an identifier number to the device (there can be a maximum of 127 devices on a network) and also tells the host computer what sort of capabilities a device has (input, ouput, etc). The device also informs the computer of its name (Vendor, Product, Version and Serial Number). Human Interface Devices (HID) are a class of USB devices that give structure to the data that will transfered between the device and the host computer.

During the enumeration process, the device describes the information that it can receive and send. This allows a host computer to handle the data being received from the USB device without requiring a specially designed device driver. The HID class is supposed to include devices such as a mouse, joystick, keyboard, etc. Because the host computer knows what the data means a device driver is not necessary for HID devices, the operating system can supply a generic HID driver.

For instance, if you plug in a USB Mouse, it will immediately work because the OS knows how to interpret information received from a mouse. Information on the HID class can be found at. You can see examples of HID de 🔗 External reference