The principle of the usb port. How does a USB stick work? Components and symptoms of an unstable USB flash drive

The USB (Universal Serial Bus) bus appeared by computer standards quite a long time ago - a version of the first approved version of the standard appeared on January 15, 1996. The development of the standard was initiated by highly reputable firms - Intel, DEC, IBM, NEC, Northen Telecom and Compaq.

The main goal of the standard set for its developers is to create a real opportunity for users to work in Plug & Play mode with peripheral devices. This means that there should be provision for connecting the device to a running computer, automatically recognizing it immediately after connecting and then installing the appropriate drivers. In addition, it is desirable to supply power to low-power devices from the bus itself. The bus speed should be sufficient for the vast majority of peripherals. Along the way, the historical problem of lack of resources on the internal buses of an IBM PC of a compatible computer is being solved - the USB controller takes only one interrupt, regardless of the number of devices connected to the bus.

USB capabilities follow from its technical specifications:

    High speed of exchange (full-speed signaling bit rate) - 12 Mb / s

    Maximum cable length for high baud rate - 5 m

    Low speed signaling bit rate - 1.5 Mb / s

    Maximum cable length for low baud rate - 3 m

    The maximum number of connected devices (including multipliers) - 127

    It is possible to connect devices with different baud rates

    No need to install additional elements by the user, such as terminators for SCSI

    Supply voltage for peripheral devices - 5 V

    Maximum current consumption per device - 500 mA

Therefore, it is advisable to connect to USB almost any peripherals except for digital camcorders and high-speed hard drives. This interface is especially convenient for connecting frequently connected / disconnected devices such as digital cameras. USB connectors are designed for mating / splitting.

The ability to use only two baud rates limits the usability of the bus, but significantly reduces the number of interface lines and simplifies the hardware implementation. Powering directly from USB is only possible for devices with low power consumption, such as keyboards, mice, joysticks, etc. USB signals are transmitted over 4-wire cable

They are intended only for connection to the source, i.e. to a computer or hub

Designed for connection to a peripheral device only

Contact number

Appointment

Wire color

Here GND is the "case" circuit for powering peripheral devices, VBus - + 5V also for power circuits. The D + bus is for transmitting data on the bus, and the D- bus for receiving data.

The full-speed cable is designed as twisted pair, is shielded and can also be used for low-speed operation. The cable for operation only at the minimum speed (for example, for connecting a mouse) can be any and unshielded.

    Main elementsUSB... Physical and logical bus architecture.

The USB (Universal Serial Bus) bus appeared in early 1996 as an attempt to solve the problem of multiple interfaces. By that time, personal computers (PCs) were equipped with a large variety of external interfaces, useful and necessary, but with one drawback: they all required their own special connector and, most often, a dedicated hardware interrupt (IRQ, Interrupt ReQuest).

Common USB architecture

Typical USB architecture implies the connection of one or more USB devices to the computer, which in this configuration is the main control device and is called host. Connecting USB devices to the host is done using cables. To connect a computer and a USB device, use hub... The computer has a built-in hub called root hub.

USB physical and logical architecture

Physical architecture USB is defined by the following rules:

o devices are connected to the host;

o physical connection of devices to each other is carried out according to the topology of a multi-tiered star, the top of which is the root hub;

o the center of each star is a hub;

o each cable segment connects two points to each other: a host with a hub or function , a hub with a function or another hub;

o A peripheral USB device or other hub can be connected to each port of the hub, while up to 5 levels of cascading of hubs, excluding the root, are allowed.

The details of the physical architecture are hidden from application programs in the system software (software), therefore logical architecture looks like an ordinary star, the center of which is the application software, and the vertices are a set end points / The application communicates with each endpoint.

USB components

The USB bus consists of the following elements:

    host controller(host controller) is the main controller, which is part of the computer system unit and controls the operation of all devices on USB bus... For brevity, we'll just write host. Only one host is allowed on the USB bus. The system unit of a personal computer contains one or more hosts, each of which controls a separate USB bus;

    device(device) can be a hub, a function, or a compound device;

    port(port) - connection point;

    hub(hub, another name - hub) Is a device that provides additional ports on the USB bus. In other words, the hub converts one port ( upstream port, upstream port) to multiple ports ( downstream ports, downstream ports). The architecture allows connection of several hubs (no more than 5). The hub recognizes the connection and disconnection of devices to ports and can control the power supply to the ports. Each of the ports can be enabled or disabled and configured for full or limited baud rate. The hub provides isolation of low-speed segments from high-speed ones. The hub can limit the current drawn by each port;

    root hub(root hub) is a hub that is part of the host;

    function(function) is a peripheral USB device or its separate unit capable of transmitting and receiving information via the USB bus. Each function provides configuration information that describes the capabilities of the USB peripheral and resource requirements. Before use, the function must be configured by the host - it must be allocated a bandwidth in the channel and the configuration options must be selected;

    logical USB device(logical device) is a set of endpoints.

    Basic propertiesUSB-devices and hubs.

USB device properties

The USB specification is quite strict about a set of properties that any USB device must support:

o addressing - the device should respond to the unique address assigned to it and only to it;

o configuration - after switching on or resetting, the device must provide a zero address to be able to configure its ports;

o data transfer - the device has a set of endpoints for data exchange with the host. For endpoints that accept different transfer types, only one of them is available after configuration;

o power management - any device when connected must not draw from the bus current in excess of 100 mA. During configuration, the device declares its current requirements, but not more than 500 mA. If the hub cannot provide the device with the declared current, the device will not be used;

o Suspension - The USB device must support suspension (suspended mode), in which its current consumption does not exceed 500 μA. The USB device should automatically suspend when the bus is no longer active;

o Remote wakeup - The remote wakeup capability allows a suspended USB device to signal a host, which may also be in a suspended state. Remote wakeup capability is described in the USB device configuration. This function can be disabled during configuration.

    Basic principles of data transfer over the interfaceUSB.

Data transfer principles

The data transfer mechanism is asynchronous and block-based. The block of transmitted data is called USB frame or USB frame and is transmitted in a fixed time interval. Operation of commands and data blocks is implemented using a logical abstraction called channel. The external device is also divided into logical abstractions called end points. Thus, a channel is a logical link between a host and an external device endpoint. A channel can be compared to an open file.

To transmit commands (and data included in the commands), the default channel is used, and to transmit data, either streaming channels, or message channels.

All USB data transfer operations are initiated by the host. USB peripherals cannot start communicating by themselves. They can only respond to host commands.

Interrupt mechanism

There is no real interrupt mechanism for the USB bus (such as for the serial port). Instead, the host polls the connected devices for interrupt data. Polling occurs at fixed intervals, usually every 1 to 32 ms. The device is allowed to send up to 64 bytes of data.

From a driver's point of view, the interrupt capabilities are actually determined by the host, which provides support for the physical implementation of the USB interface.

Data transfer modes

The 1.1-compliant USB bus has a bandwidth of 12Mbps (i.e. 1.5Mbps). Specification 2.0 defines a bus with a bandwidth of 400 MB / s. The bandwidth is shared among all devices on the bus.

The USB bus has three data transfer modes:

o low-speed (LS, Low-speed);

o full speed (LF, Full-speed);

o high-speed (HS, High-speed, only for USB 2.0).

Logical levels of data exchange

The USB specification defines three logical level with certain rules of interaction. The USB device contains interface, logical and functional parts. The host is also divided into three parts - interface, system and software. Each part is responsible only for a certain range of tasks.

Thus, the data exchange operation between the application program and the USB bus is performed by passing memory buffers through the following layers:

o client software level in the host:

· Usually represented by a USB device driver;

· Provides user interaction with the operating system on the one hand and the system driver on the other;

o level system driver USB in host (USB, Universal Serial Bus Driver):

· Manages the numbering of devices on the bus;

· Manages the distribution of bus bandwidth and power supply;

· Handles requests from custom drivers;

o host controller level of the USB bus interface (HCD, Host Controller Driver):

· Transforms I / O requests into data structures on which physical transactions are performed;

· Works with host registers.

The responsibilities of the host include:

Tracking the connection and disconnection of devices

    Organization of control streams between USB device and host.

    Organization of data streams between USB device and host

    Monitoring device status and keeping activity statistics

    Power supply of connected devices The hardware is a host controller - an intermediary between the host and devices on the bus

    Physical interfaceUSB

The USB standard defines the electrical and mechanical specifications for the bus. Information signals and a 5 V supply voltage are transmitted over a four-wire cable. A differential method of transmitting D + and D- signals over two wires is used. Static transmitter signal levels must be less than 0.3 V (low) or above 2.8 V (high). Receivers withstand input voltages within -0.5 ... + 3.8 V. Transmitters must be able to transition to a high-impedance state for bidirectional half-duplex transmission over one pair of wires.

USB two-wire transmission is not limited to differential signals. In addition to the differential receiver, each device has line receivers for D + and D- signals, and the transmitters of these lines are controlled individually. This makes it possible to distinguish between more than two line states used to organize the hardware interface. The states Diff0 and Diff1 are determined by the potential difference on the D + and D- lines more than 200 mV, provided that the potential on one of them is higher than the VSE response threshold. A condition in which both D + and D- are low is called a linear zero (SEO - Single-Ended Zero). The interface defines the following states:

* Data J State and Data K State - the states of the transmitted bit (or simply J and K), are determined through the states Diff0 and Diff1.

* Idle State - pause on the bus.

* Resume State - "wake up" signal to wake up the device from "sleep" mode.

* Start of Packet (SOP) - the beginning of the packet (transition from Idle State to K).

* End of Packet (EOP) - the end of the packet. * Disconnect - the device is disconnected from the port. * Connect - the device is connected to the port. * Reset - reset the device.

The states are determined by combinations of differential and linear signals; for full and low speed, the DiffO and Diff1 states have the opposite purpose. The decoding of the Disconnect, Connect and Reset states takes into account the time that the lines (more than 2.5 ms) are in certain states.

The bus has two transmission modes. The full USB signal transmission rate is 12 Mbps, the low one is 1.5 Mbps. For full speed, a shielded twisted pair cable with an impedance of 90 ohms and a segment length of up to 5 m is used, for low speed - unshielded unshielded cable up to 3 m. Low-speed cables and devices are cheaper than high-speed ones. The same system can use both modes at the same time; switching for devices is transparent. Low speed is designed to work with a small number of launchers that do not require high speed. The speed used by a device connected to a specific port is determined by the hub based on the signal levels on the D + and D- lines, shifted by the pull-up resistors R2 of the transceivers

    Data coding during bus transmissionUSB.

    NutritionUSB-devices. Energy management.

    Internal organization of the busUSB... Logical levels of data exchange.

    Types of data transmission used in the busUSB... Endpoints and channelsUSB.

Each USB device is a set of independent endpoints with which the host controller communicates. Endpoints are described by the following parameters:

* required frequency of access to the bus and admissible service delays;

* required channel bandwidth;

* point number;

* requirements for error handling;

* maximum sizes of transmitted and received packets;

* type of exchange;

* direction of exchange (for continuous and isochronous exchanges).

Each device necessarily has an endpoint numbered 0, which is used for initialization, general control and polling of its status. This point is always configured at power up and when the device is connected to the bus. It supports transfers of the "control" type (see below).

In addition to the zero point, function devices can have additional points that implement useful data exchange. Low speed devices can have up to two additional points, full speed devices can have up to 16 input points and 16 output points (protocol limitation). The points cannot be used until they are configured (the establishment of a channel coordinated with them).

A pipe in USB refers to the communication model between the host controller and the endpoint of the device. There are two types of channels: Streams and Messages. The stream delivers data from one end of the channel to the other, it is always unidirectional. The same endpoint number can be used for two streaming channels - input and output. A stream can implement the following exchange types: continuous, isochronous, and interrupts. Delivery is always in first-in-first-out (FIFO) order; from the USB perspective, the stream data is unstructured. Messages are in the format defined by the USB specification. The host sends a request to the endpoint, followed by a message packet (received), followed by a packet of endpoint status information. The subsequent message normally cannot be sent before the processing of the previous one, but during error handling it is possible to discard unhandled messages. Two-way messaging addresses the same endpoint. Only control exchange is used for message delivery.

Channels are associated with characteristics appropriate to the endpoint (bandwidth, type of service, buffer size, etc.). Channels are organized when configuring USB devices. For each device that is switched on, there is a message channel (Control Pipe 0) that carries configuration, control and status information.

5. Types of data transmission

USB supports both unidirectional and bidirectional communication modes. Data transfer occurs between the host software and the device endpoint. A device can have several endpoints, communication with each of them (channel) is established independently.

The USB architecture allows four basic types of data transfer:

* Control Transfers, used for configuration during connection and during operation to control devices. The protocol provides guaranteed data delivery. The length of the data field of the control message does not exceed 64 bytes at full speed and 8 bytes at low speed.

* Bulk Data Transfers of relatively large packages without stringent delivery time requirements. Transfers take up the entire free bus bandwidth. Packets have a data field of 8, 16, 32, or 64 bytes. These transmissions have the lowest priority and can be suspended when the bus is heavily loaded. Only allowed at full baud rate.

* Interrupt - short (up to 64 bytes at full speed, up to 8 bytes at low) transmission of the type of input characters or coordinates. Interrupts are spontaneous and should be serviced no slower than the device requires. The service time limit is set in the range of 1-255 ms for full speed and 10-255 ms for low speed.

* Isochronous Transfers - continuous, real-time transfers that take up a pre-agreed portion of the bus bandwidth and have a specified delivery delay. If an error is detected, isochronous data is transmitted without retry - invalid packets are ignored. An example is digital voice transmission. The bandwidth is determined by the requirements for the transmission quality, and the delivery delay can be critical, for example, when implementing teleconferencing.

The bus bandwidth is divided among all installed channels. The allocated bandwidth is assigned to the channel, and if the establishment of a new channel requires a bandwidth that does not fit into the existing allocation, the channel assignment request is rejected.

The USB architecture provides for internal buffering of all devices, and the more bandwidth a device requires, the larger its buffer should be. USB must be able to exchange at such a speed that the latency of data in the device caused by buffering does not exceed a few milliseconds.

Isochronous transfers are classified according to the way the endpoints - sources or recipients of data - synchronize with the system: they distinguish between asynchronous, synchronous and adaptive device classes, each of which corresponds to its own type of USB channel.

    PeripheralsUSB... The use of microcircuits of the companyFTDIas converters to serial and parallel interfaces.

D0… D7 - bi-directional data bus in direct code (1 - high level, 0 - low level) with three states;

RD # - read data strobe input. When RD # is low, data from the receive buffer of the FIFO type with a length of 128 bytes of the FT8U245AM chip appears on the D0 ... D7 bus, if at least one byte is present in the buffer. On the transition from low level to high level, data is taken from the data bus;

WR - write data strobe input. Data from the D0 ... D7 bus goes into the 384-byte FIFO transfer buffer of the FT8U245AM chip on the transition from high to low level at the WR pin, provided that this buffer is not completely full;

TXE # - output of the presence of space in the transmission buffer of the FT8U245AM microcircuit. When this pin is low, data can be transferred to the transfer buffer on the D0 ... D7 bus;

RXF # - output of data presence in the receive buffer of the FT8U245AM microcircuit. When this pin is low, data can be read on the D0 ... D7 bus;

Rice. 1. Timing diagram of the reading cycle.

Fig. 2. Timing diagram of the write cycle.

    InterfaceI 2 C... Serial Bus BasedI 2 C... The main specifications tiresI 2 C.

I 2 C is a two-wire interface developed by Philips Corporation. In the initial technical requirement for the interface, the maximum data transfer rate was 100 Kbps. However, over time, standards have appeared for higher-speed modes of operation of I 2 C. Devices with different access speeds can be connected to the same I 2 C bus, since the data transfer rate is determined by the clock signal.

The data transfer protocol is designed in such a way as to ensure reliable reception of the transmitted data.

When transferring data, one device is the "Master", which initiates data transfer and generates synchronization signals. Another device “Slave” - starts transmission only on the command received from the “Master”. The PIC16CXXX microcontrollers have hardware implemented the “Slave” mode of the device in the SSP module. The "Master" mode is implemented in software. The main terms used to describe the operation with the I 2 C bus:

Transmitter- a device that transmits data on the bus

Receiver- device receiving data from the bus

"Master"- the device that initiates the transfer and generates the clock signal

"Slave"- the device to which the "Master" is addressing

Multi- "Master"- I 2 C bus operation mode with more than one "Master"

Arbitration- a procedure to ensure that only one "Master" controls the bus

Synchronization- procedure for synchronizing a clock signal from two or more devices

The output stages of the synchronization (SCL) and data (SDA) signal conditioners must be made according to open collector (drain) circuits to combine several outputs and connected through an external resistor to the positive power supply so that the bus is at level "1" when one device does not generate a "0" signal. The maximum capacitive load is limited to 400 pF.

The built-in hardware noise suppression algorithm ensures data integrity in the presence of significant interference. All I2C-compatible devices have an interface that allows them to communicate with each other over the bus, even if their supply voltage is significantly different. The following figure shows the principle of connecting several ICs with different supply voltages to one exchange bus.

Each device is recognized by a unique address and can work as a transmitter or receiver, depending on the purpose of the device.

In addition, devices can be classified as masters and slaves when transmitting data. A master is a device that initiates data transfer and generates synchronization signals. In this case, any addressable device is considered a slave in relation to the master.

Based on the specification of the bus operation, at any given moment there can be only one master in the bus, namely the device that provides the formation of the SCL bus signal. The presenter can act both as a master-transmitter and a master-receiver. Nevertheless - the bus allows you to have several masters, imposing certain features of their behavior in the formation of control signals and control of the bus state. The ability to connect more than one master to the bus means that more than one master can try to start a transfer at the same time. To eliminate the "collisions" that may arise in this case, an arbitration procedure has been developed - the behavior of the master when it detects a bus "seizure" by another master.

Synchronization procedure for two devices This procedure is based on the fact that all I2C devices are connected to the bus according to the wiring rule. In the initial state, both SDA and SCL signals are high.

    Bus communication protocolI 2 C... Bus Signal AssignmentI 2 C... Timing diagrams of the data transfer procedure.

Principle of operation

Physically, the I2C bus is a two-wire interface with bidirectional serial lines.

synchronization (SCL) and data line (SDA). The I2C bus supports multiple slaves and masters, but only one master can be active at a time. Any I2C device can be connected to the bus and communicate with the master. All devices are recognized by a unique address and can be used as a transmitter or receiver, depending on their function. Initially, the I2C bus used 7-bit addresses, now they are 10-bit. Supporting

There are three bit rates: 100 kbps (standard mode), 400 kbps (fast mode) and 3.4 Mbps (fast mode). The maximum number of connected devices is determined by the maximum capacitance of 400 pF or approximately 20-30 devices. The I2C standard defines the following format, shown in Fig. 4:

- Start - indicates that bus control has been transferred to the device and a message will be sent

- Address - 7- or 10-digit number corresponding to the address of the device from which

to read data or to which data will be written.

- R / W Bit - one bit indicating that data will be read from one device

wa or write to another device

- Ack - one bit of the slave with confirmation of the master's action

wah. Typically, an acknowledgment is required for every Ibyte of data address, but not always.

- Data - An integer number of bytes read or written by the device.

- Stop — Indicates the end of the message, the master releases the bus.

While there is no data transfer on the bus, the SCL and SDA signals are high due to the external resistor.

The START and STOP signals are generated by the “Master” to determine the start and end of data transmission, respectively.

The START signal is formed by the transition of the SDA signal from high to low level when the SCL signal is high. STOP signal is defined as SDA transition from low to high when high level SCL. Thus, when transmitting data, the SDA signal can only change when the SCL signal is low.

Connector USB type A most common and most recognizable. Computer mice, keyboards, external hard drives equipped with this connector. The development of this USB form factor was completed in the 90s of the last century, the release took place along with the first version of the standard. The main advantage is robustness and reliability, allowing it to withstand a large number of connections without any problems. Despite the rectangular shape of the connector, it cannot be inserted incorrectly, thanks to the special protection. However, due to its large dimensions, it was not suitable for portable devices, smaller USB connectors have been developed.

Connectors USB typeB usually used to connect peripheral devices to a computer on the device side. Now this type of connector is not common. There are also portable type B connectors - MiniUSB andMicroUSB.

The emergence of Mini USB was due to the widespread use of miniature devices, the size of which did not allow the use of full-fledged connectors. However, it soon became clear that this connector was not reliable. Therefore, it was replaced by the Micro USB specification. The modified shape allowed for a firm grip in the device, moreover, the connector was even smaller than the Mini USB. The use of Micro USB has become the de facto standard for all compact devices. But already now it is being replaced by USB type C.

USBType-C or USB-C is the last of the presented standards USB connectors... The specification was released in 2014. This version provides high speed data transfer as well as two-way connectivity.

USB standards

On January 15, 1996, the first specification of the universal serial bus standard was introduced - USB 1.0... The data transfer rate did not exceed 12 Mbps, and the maximum current supplied to the connected devices was 500 mA.

VersionUSB 1.1 only corrected mistakes made in the design of the first specification, but it was 1.1 that was first widely used. The USB 2.0 standard was announced in April 2000 and served as an update to USB 1.1.

USB 2.0 provided additional bandwidth for applications, media, and storage. The data transfer speed has increased 40 (!) Times. To ensure a smooth transition to new standard for both consumers and manufacturers, USB 2.0 had full compatibility with original USB devices.

This standard supports three speed modes (1.5, 12 and 480 megabits per second):

  • Low Speed ​​(no more than 1.5 Mbps) - keyboards, mice, joysticks;
  • Full Speed ​​(no more than 12 Mbps) - audio and video devices;
  • High Speed ​​(no more than 480 Mbps) - high-performance peripherals;

The introduction of USB 2.0 has made it possible to greatly advance in the development of peripheral "devices" for personal computers... This standard allowed several power-hungry devices to be connected to the host at the same time.

Standard USB 3.0 (SuperSpeedUSB) became official on November 17, 2008. The new specification supported transfer rates 10 times faster (up to 4.8 gigabits per second) than USB 2.0. The maximum current supplied to peripheral devices has increased from 500 mA to 900 mA. This allowed not to use additional power supplies for some gadgets, as well as to increase the number of devices powered by one port.

The transition to USB 3.0 has been very slow. Intel has postponed the introduction of the standard into its chipsets until 2011. The software also lacked support for the new specification: neither Windows nor Linux could work with version 3.0 at that time.

In the summer of 2013, an updated standard was developed - USB 3.1... The data transfer rate has increased to 10 Gbps. The 3.1 standard is backward compatible with versions 2.0 and 3.0. It was with this version that new USB Type-C connectors began to appear.

USB 3.2 promises to double the data transfer rate again - up to 20 Gbps.

USB hubs (USB hubs, USB hubs)

Computers have at least one or two USB ports. But with so many USB devices on the market, you will quickly run out of available ports. You can have a keyboard, mouse, printer, microphone and webcam connected via USB at the same time. The obvious question arises: "How to connect all devices?"

An easy solution to the problem is to buy an inexpensive USB hub (hub). What is a USB hub?

USB hub is a device that acts as an "adapter" from one USB connector to more.

The USB standard supports connecting up to 127 devices to a single port, and USB hubs are part of the standard. In addition, using USB hubs, you can increase USB length wires from the maximum possible for one cable 5 meters to 30.

You plug a splitter into your computer and then plug your devices (or other splitters) directly into it. By connecting the hubs together, you can create dozens of available USB ports on a single computer.

Hubs may or may not power connected devices. Power-hungry devices (printers, scanners, etc.) have their own power supply, but devices with low power consumption(mice, keyboards, etc.) are powered by the computer. This greatly simplifies the work with them. Power (up to 500 milliamps at 5 volts for USB 2.0 and 900 milliamps for USB 3.0) comes from the computer's bus. If you have many self-powered devices (such as printers and scanners), then your hub does not need power. If you have a lot of unpowered devices such as mice and keyboards, you probably need a powerful hub with its own power supply.

How does USB work?

As we already said, several devices can be connected to one USB host at the same time. Each device is assigned a unique address- 7-bit binary number (hence the limit of 127 devices). At the moment of connecting to the host, the device sends data containing information about the type of device, manufacturer, etc. Based on this data, the host decides in which mode to work with this machine.

Data exchange between devices is carried out using transactions- sequences consisting of several packets (blocks) of information. The exchange always starts with sending a small packet (token) from the host, which contains information about the device address, direction of transmission, and so on. In order not to go too deep, we will give an example of the most commonly used tokens:

  • IN(the host is ready to receive data from the device);
  • OUT(the host is ready to transmit data to the device);
  • SETUP(the host informs the device about the subsequent transfer of configuration information);

One transaction can transmit several packets at once, provided that the length of the data in the packet is the maximum allowed. Data transmission ends when an incomplete data packet is received. After that, the device sends back a confirmation packet about the successful or unsuccessful completion of the operation. Packets in a transaction are transmitted continuously and without pauses, the delay should not exceed 1 microsecond. If the pause is extended, then the transaction will be considered false.

The use of USB ports and connectors has become ubiquitous. They are used both on computers and on mobile devices, and on storage devices. USB connectors have greatly facilitated the process of powering devices and transferring data in the modern world.

You can read about what a flash drive is on many sites. They will also tell you in detail what not to do with it. But how do you know what you can do with it? What if a lesson with a visual demonstration on all points (from A to Z) about working with a flash drive? Let's say that you want to transfer text from one computer to another (let the second computer not be connected to the Internet).

And in the second case, a cartoon, in the third case, both. What is most important in the lesson is ALL sequential transfer actions.

Original requirement? But this is the only way to show, explain, protect the dunno (a pebble in the garden of beginners, not to cope with it with a flash drive) from unnecessary and unnecessary actions!

There is a lot of information about a USB flash drive, but there is no specific step-by-step “instructions” for working with a USB flash drive! But in vain! I am sure that many have such “difficulties”, but write about them. So keep a lesson about working with a USB flash drive.

This is what a regular flash drive looks like.

Step 1. Insert it intoUSB port(see picture).

There are usually headphone and microphone jacks next to this port.

Here they are next to green and pink.

Step 2. Now press "Start". Then "My Computer". Among the pictures you will see a picture of a removable disk. It can have any name.

The main thing is its visual image in the picture.

For example, "KINGSTON (F :)". In this case, "KINGSTON" means the name of the manufacturer of the flash drive, and (F :) is the name of the disc.

Step 3. Write information to the flash drive can be done in at least 2 ways. Let's consider both.

1 way. Let's continue where we left off.

1. Click on the image of the flash drive with the left mouse button. As a result, its contents will open to you.

2. Select from the desktop or any other folder desired file (Text Document, music, video, whatever) that you want to copy to a flash drive.

3. Now grab it with the left mouse button and drag it into the USB flash drive folder. Letting go.

Everything. You have copied the file to the USB stick!

2. method.

1.Choose the file you need to copy to a USB flash drive.

2. Click on it with the right mouse button.

3. Select the item "Send"

4. Then select the item with the image of the flash drive. In our example, "KINGSTON (F :)".

5. Everything, the file is sent to the USB flash drive. You can check its presence on the flash drive.

Step 4. Information you wrote down ... Now you need to safely remove the USB flash drive from your computer. To do this, do the following.

That's all. Now you have mastered the work with a flash drive. And we are ready to conquer new computer horizons! I wish you success in this!

5 honest services making money on the Internet

That's all there is to arbitration. Any system that requires multiple devices to be connected needs some definition of who should speak when. There are various schemes that one would expect depending on the application.

A common example is that we have many nodes on the network that all communicate with each other. This is done by every node that has an address (like an IP address), and when a node wants to talk to another node, it sends a packet to that address. Then you have devices like routers that take packets coming in on multiple ports and forward them to the correct port. Arbitration is performed using memory to store packets until the destination port becomes free.

Now on USB. In fact, it is much simpler than networks because not all nodes become equal. You have two kinds: host and endpoint. There is only one host, but there can be many endpoints. In this case, arbitration is much easier because only the host port is allowed to speak on its own. The endpoints are then only allowed to talk when requested by the host, and the host is always only talking to one endpoint at a time.

For host-> endpoint packets, USB hubs simply forward the request from the host to all endpoints. Since all endpoints have an address, only the one to which the request was addressed will do anything with it (for example, respond), all others will ignore the packet.

For endpoints-> host packets, the host first sends the packet to a specific endpoint to the address to say "you can talk now" and then that endpoint should send a response immediately. Since only one endpoint is allowed to talk at any given time, the USB hub will simply forward the packet from whichever port responds to the request from the host.

Then you might ask, "Okay, how can I use multiple devices at the same time?" Let's say you have a mouse, keyboard, and flash drive, all connected to the same USB hub. We all know that you can use your mouse and keyboard at the same time, and copy files to a flash drive, but if only one device can speak at a time, how is that possible?

Well, it all comes down to the fact that the few hundred milliseconds it takes for your brain to notice that you have pressed a key and wait for the screen to refresh is an eternity for the computer. The USB 2.0 interface can handle speeds up to 480 Mbps (USB 3.1 can handle speeds up to 10 Gbps!) Which means that while the host is always talking to one endpoint at any given time, it moves so quickly between by them that you cannot say that he does it.

USB Host:.?“Hey mouse on port 1, tell me if you've moved Ok, now keyboard on port 2 you have any keystrokes to report. Now you're there on port 3, flash drive, save this data for me. Anyone I need to talk to? nope, okay, mouse on port 1, tell me if you have moved ... "

Human:“Oh look, the computer noticed that I just moved the mouse, pressed a key on the keyboard and copied the picture to the USB stick, at the same time! "

The host device keeps track of which endpoint addresses are in use and will send packets to each sequentially or as needed (that is, when an OS request requests access to a specific device). So while it doesn't happen simultaneously, the arbitrage is so fast that the computer animals can't tell one from the other.

Today USB has supplanted almost all other interfaces for connecting computer peripherals (see the sidebar "External interfaces - competitors to USB"), which has become a guarantee of its indisputable advantages.

■ Prevalence. Any computer released in recent years is equipped with one or more USB ports (on modern desktop PCs there are up to 12, on the vast majority of laptops - 3-4). The choice of USB devices is huge.

■ Easy to use. USB is the perfect embodiment of the Plug and Play principle. Devices with this interface can be connected and disconnected while the computer is running. Modern operating systems immediately recognize USB devices and load the necessary drivers. On many computers for better accessibility USB ports placed on the front or side of the case. In addition, it is impossible to mix up the connectors and connect the peripherals incorrectly.

■ High throughput... For the USB 2.0 interface, it is 480 Mbps. Copying a 700 MB file to a USB drive will take less than 20 seconds.

■ Providing food. The USB port not only serves to connect peripherals, but can also "feed" low-power gadgets, such as mice, keyboards, flash drives and even 2.5-inch hard drives. The USB bus supply voltage is 5 V at a current strength of up to 500 mA. This is, of course, not enough for comparatively high power consumption peripherals such as printers or 3.5 ”external hard drives. Therefore, they are equipped with their own power supplies that plug directly into the mains socket.

SIMPLE AND EASY

The connecting hub for all USB devices is the computer. Only with him can they "communicate" directly. This connection is called "point-to-point".

When connected for the first time, the USB device is automatically detected by the operating system, after which it searches for desired driver... In this case, the rule applies: what newer version used operating system, the more likely the user will not have to install the driver themselves. For example, Windows XP and Vista automatically recognize flash drives, card readers and external hard drives and register them as removable drives. The drivers required for these devices are included in Windows distribution and are always “at hand” by the system. Windows Vista also has additional drivers for the most common models of printers, scanners, gaming keyboards and other devices.

ADVICE

With rare exceptions, USB gadgets can exchange data with each other only through the mediation of a computer. In this case, the PC acts as a so-called USB host. He asks each device connected via USB and called a client, information about the availability of data necessary for the transfer, and then organizes a "dialogue". Transferring files "on their own" to clients is prohibited. This method, called a survey, although it takes away part system resources, however, makes it possible to create simple and therefore inexpensive USB devices.

USB connector types

There are two types of USB connectors and plugs: Type A is used to connect USB devices to laptops and desktops. Type B connectors are available for USB peripherals. There are several variants of the second type connector: proper B, Mini-B and Micro-B.

Type A. The Type A connector connects to the Type A USB connector on a computer or USB hub. Some printers and multifunctional devices also equipped with a type A connector - for connecting cameras.

Type B. The Type-B connector plugs into the corresponding USB port commonly found in large peripheral devices such as MFPs, printers, and scanners.

Mini-USB (type B). Smaller USB devices such as digital cameras, PDAs or Cell Phones, are equipped with a smaller version of the type B connector, called Mini-USB (or, more correctly, Mini-B).

Micro-USB (type B). There is a USB connector even more compact than Mini-B - this is a Micro-B connector. They are most often found on mobile phones.

Direct communication between two USB gadgets is possible using On-The-Go technology. Its use will allow you to print images without the mediation of a computer or directly exchange music files between MP3 players.

ADVANTAGES OF COMPETITORS

USB, eSATA, and FireWire differ from each other primarily in terms of data transfer rates (see the sidebar "USB, eSATA, and FireWire Bandwidths Compared").

External Interfaces - Competitors to USB

FireWire. Interface for connecting video cameras and external hard drives. The FireWire 800 standard provides for operation at higher speeds than the USB 2.0 standard, but today it is losing its relevance.

SATA and eSATA. Along with the SATA interface used for connecting internal hard drives, there is eSATA for connecting external disk drives... ESATA transfers data up to four times faster than USB 2.0. Perhaps eSATA is the only interface that has a clear advantage over USB and is not going to give up positions.

PS / 2. This once standard interface for connecting input devices is slowly becoming a thing of the past with the advent of USB. The purple PS / 2 connector is traditionally for the keyboard, the green one for the mouse.

Parallel port. Before USB became widespread, the parallel port was the traditional interface for connecting printers and scanners. Now it is less and less common.

Game port (MIDI port). Joysticks or musical MIDI keyboards used to be connected to the game port. Today, such devices use a USB connector for connection, so MIDI ports are rare.

Serial port. The serial port (COM port), to which a mouse and modem were previously connected, is absolutely useless on a home PC today. This interface is used in industry to control special machines.

External SCSI interface. Earlier, along with common external hard drives with IDE interface, drives with SCSI interface, which today are only relevant for server systems.

■ eSATA is used to connect external hard drives, and more recently - and some models of flash drives. Unlike USB and FireWire, external hard drives with an eSATA interface, no data conversion is required, which eliminates an additional link that slows down interaction with a PC. Therefore, the speed of such hard drives is at the level of hard drives built into computers. If you need maximum productivity external devices then eSATA is the best solution. ■ FireWire is primarily used to connect video cameras and some models of hard drives to a PC. Current version FireWire 800 is significantly faster than USB 2.0 (800 versus 480 Mbps). But devices with a Fire Wire interface are usually more expensive than those with USB.

USB, eSATA, and FireWire throughput in comparison


If you are planning to buy an external HDD, then you have to choose one of several possible interfaces for its connection, which have different bandwidth: the highest data transfer rate is provided by eSATA, followed by FireWire 800 and USB 2.0 closes the race. But the latter has its own trump card: the USB connector is present on any computer.

The current balance of power will change the output of devices with a USB 3.0 interface, which will become the fastest data transfer interface. But it will take a long time before the new USB standard becomes widespread.

USB STANDARDS

■ USB 1.1. Computers manufactured before 2002 provide the user with a USB 1.1 interface. Data transfer according to this standard is rather slow. The theoretical peak throughput is 12 Mbps (or 1.5 Mbps). For input devices - keyboard and mouse - this is quite enough.

On a note. More early version, USB 1.0 did not get widespread, and remained on paper. Finished products meeting this standard were not available for sale.

■ USB 2.0. Computers and laptops manufactured after 2003 are usually equipped with USB 2.0 ports. The maximum speed in comparison with the 1.1 standard has significantly increased and amounted to 480 Mb / s (or 60 Mb / s). Although in practice it is not possible to achieve this level of throughput.

Higher bandwidth is provided by USB 2.0 devices bearing the “USB 2.0 Hi-Speed” logo. If the box or case of the device says "USB 2.0 Full-Speed", this means that data will be transferred at the speed of the USB 1.1 standard.

"SLOW ACTION"


If Windows does not automatically detect the connected USB device, you will have to install the driver for it yourself (as a rule, you can find it on the disc supplied with the USB device). Having bought a printer or MFP with a USB interface, do not rush to connect it right away: first, look at the user manual and read the installation procedure to understand whether you need to install the software or what is available in the OS will be enough. Otherwise, Windows may install a driver with less functionality, or it may not recognize the device at all.

Another advantage of the USB hub is that it can be installed wherever you like. This will eliminate the need to climb under the computer desk looking for the right port to plug in the USB connector. In addition, if the length of the USB cable is not sufficient to connect the device, the hub can act as an extension cable, the easiest way to do this is using the so-called USB splitters (USB hubs). These small "boxes" are available at a price of 100 rubles. Occupying only one USB port on a computer, such a device usually provides four (or more) ports in return. In theory, using USB hubs allows up to 127 USB devices to be connected to one computer.

Please note that there are two types of hubs.

■ Active. It uses a separate power supply as a power source, which is included with the hub. The USB ports of such a splitter are capable of providing the maximum amperage for this interface, so even such "power hungry" devices as external hard drives can be connected to active hubs.

■ Passive. Power is supplied to it from the USB port of the computer and is divided between all ports, so passive hubs are suitable only for connecting devices with low power consumption.

USB over network

The Belkin Components USB Network Hub allows you to connect up to five USB devices that will communicate with your computer over the network. With the help of a WLAN router, you can arrange for them wireless connection.

WHAT IS THE MAXIMUM LENGTH OF THE USB CABLE

An expansion card installed in a PCI slot can be considered an alternative to a hub. motherboard PC. When using it, you will have several additional USB connectors (usually four). Such boards can be purchased at a price of 300 rubles. Disadvantage: additional USB ports will be located on the back of the system unit.

The maximum length of a standard USB cable is 5 meters. If this is not enough, special extension cords will be required (after each 5-meter section, a kind of self-powered repeater is needed, which, by the way, can also be a USB hub). With their help, a connection length of 25 meters can be achieved. The use of the so-called USB Line Extender (worth 1000 rubles or more; this device is a USB adapter and a hub, which are connected by a standard network cable) will allow you to cover a distance of 60 meters.

What the USB logos mean

Most USB devices have one or more of the following logos on their packaging. Their presence indicates that the device complies with technical requirements described in specifications and documents non-profit organization USB Implementers Forum. If you come across a designation that is not on our list, be careful: you may be dealing with inferior “third party” products that may not support the stated characteristics.

A LITTLE ABOUT WIRELESS USB

Wireless USB is a new standard designed to enable wireless communication via USB. The endless wires on and under the desk would be a thing of the past if printers, scanners, external hard drives and MP3 players could communicate with a computer without using a cable. This new technology offered by the USB Imple menters Forum will help make this dream come true.

New USB cable

A “traditional” USB cable has four wires. Two of them transmit data, the other two are used for power supply. For the new high speed mode USB operation version 3.0, four wires are no longer enough, so the new cable will have four additional lines for data: the first pair will serve for receiving, the second for transmission. Advantage: unlike USB 2.0, data reception and transmission will be carried out simultaneously and on maximum speed. USB cable 3.0 will be equipped with a new connector with five additional pins.

As an example, consider how you can simultaneously connect a conventional USB printer and scanner using Wireless USB. In this case, it will still not be possible to do without wires: both devices will have to be connected with cables to a wireless USB hub, which "on their behalf" will communicate with the computer. In this case, a corresponding wireless USB adapter must be installed in the PC. V this case the printer and scanner will be recognized by the system as devices connected to the computer in the traditional way.

It is worth taking into account the fact that the maximum transmission speed of 480 Mbit / s wireless interface USB provides only if the distance between the hub and the computer does not exceed three meters. The bandwidth of the Wireless USB decreases over a longer distance. If there are obstacles, such as a wall, in the path of the wireless communication link, data transmission will not be possible.

On a note. An alternative to Wireless USB solutions are USB hubs that connect to local network... They can be connected to a WLAN router, which also makes it possible to wirelessly connect USB devices and a computer.

WHAT'S NEW IN USB 3.0

The USB 3.0 standard is a further development of the USB 2.0 interface, bringing a number of improvements to it.

■ Throughput. In practice, USB 2.0 allows data transfer at a maximum speed of just over 30 Mb / s. This limits the capabilities of many devices, primarily external disk drives, which are capable of operating at speeds exceeding the specified speed 2–4 times. In USB 3.0, the bandwidth will immediately grow 10 times and reach the level of 5 Gb / s. For this purpose, USB 3.0 is equipped with a more sophisticated data transfer technology, which requires not 8, but 10 bits to transfer one byte. Therefore, the real speed limit for data transfer will be approximately 500 Mb / s. However, even such results are unlikely to be achieved - the stumbling block will be the high-speed capabilities of external devices (the same drives), which significantly lag behind in speed. USB capabilities 3.0.

■ Connectors. One of the main challenges facing the developers of the new standard is maintaining the compatibility of USB 3.0 and 2.0 connectors. As a result, you can easily connect USB device 2.0 to USB 3.0 connector. But those who want top speed will still need to purchase new cables (see the sidebar "New USB Cable"). They are more complex and cost more than comparable USB 2.0 cables. In addition, not all connector types will be backward compatible with the old USB 2.0 standard. If in the case of USB type A connectors it was possible to get by with a little blood, "inscribing" five new contacts into the existing connector design, then with USB type B connectors, and even more so Micro-B, everything turned out to be much more complicated. In this case, we had to change the design of the connector, essentially dividing it into two parts: the first one is an "old" USB 2.0 port to maintain compatibility with the previous standards, the second one combines five new lines that appeared in USB 3.0. Therefore, these types of connectors cannot be plugged into a USB 2.0 port.

■ Nutrition. USB 3.0 connectors handle more amperage than anything previous versions USB: 900 instead of the previous 500 mA. This is important, for example, when using external hard drives.

■ Energy saving. In USB 2.0, the host had to constantly poll the connected devices to find out if they had a new piece of data, so they all had to be constantly active. Abandoning such cyclic polling in USB 3.0 will allow the use of power saving mode.