• No results found

Real-time Operating Systems Lecture 27.1

N/A
N/A
Protected

Academic year: 2021

Share "Real-time Operating Systems Lecture 27.1"

Copied!
8
0
0

Loading.... (view fulltext now)

Full text

(1)

14.7. Universal Serial Bus (USB)

General References

http://www.usb.org.

http://www.beyondlogic.org/usbnutshell/

USB References

http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf

http://www.ftdichip.com/Drivers/D2XX.htm

http://www.ftdichip.com/Documents/InstallGuides/Windows_XP_Installation_Guide.pdf

http://www.dlpdesign.com/test.shtml

http://www.ftdichip.com/Projects/CodeExamples.htm

http://www.dlpdesign.com/drivers/D2XXPG21.pdf

FifoWrite

Microphone Amp ADC

Windows USB stack ADC your application OC ISR Sound Voltage 0 to 5V 0 to 1023 UM245R PC USB USB v t v f FTD2XX .sys FTD2XX .DLL ADC_In

Old Lab 4.1. Data-flow graph of the digital scope and spectrum analyzer.

Specifications

Short distance (typically less than 4 meters)

USB 2.0 supports three speeds.

High Speed - 480Mbits/s

Full Speed - 12Mbits/s

Low Speed - 1.5Mbits/s

One host per bus (at a time)

all transactions and scheduling bandwidth

Token-based protocol

Tiered star topology (Host-centered)

Hub provides power

Monitors power

Switching off a device drawing too much current

Filter out high speed and full speed transactions

7-bit address, up to 127 devices can be connected

Host loads and unloads drives automatically

(2)

Host Hub1 Hub2 device device Root Hub device device device device device Hub3 device device

Figure 14.31. USB network topology.

1 2 3 4 USB Type A 1 2 3 4 USB Type B

Figure 7.18. USB connectors.

Pin Number

Color

Function

1

Red

VBUS (5 V)

2 White

D-

3 Green

D+

4 Black

Ground

Table 7.5. USB signals.

The D+ and D- are twisted pair differential data Non Return to Zero Invert (NRZI) encoding 1 is represented by no change in level

0 is represented by a change in level

String of zeros causes the NRZI data to toggle each bit time String of ones causes long periods with no transitions in the data Bit stuffing ensures transitions to which the receiver can synchronize

0 inserted after 6 consecutive 1’s 1 inserted after 6 consecutive 0’s

0 1 1 0 1 0 1 0 0 0 1 0 0 1 1 0

Idle Idle Data

(3)

The USB architecture comprehends four basic types of data transfers:

• Control Transfers: Used to configure a device

• Bulk Data Transfers: Large quantities and wide latitude in constraints.

• Interrupt Data Transfers: Used for timely but reliable delivery of data.

• Isochronous Data Transfers: Prenegotiated bandwidth

Prenegotiated latency

Streaming real time transfers

Audio or video applications

Stream pipe

Unidirectional

1.5kΩ ±5% +3.3V Host or Hub Full Speed Device D+ D-D+ D-15kΩ ±5% 15kΩ ±5% 1.5kΩ ±5% +3.3V Host or Hub Low Speed Device D+ D-D+ D-15kΩ ±5% 15kΩ ±5%

Figure 14.32. Pull-up resistors on USB devices signal specify the speed.

Each USB transaction consists of three packets

• Token Packet (header),

• Optional Data Packet, (information) and

• Status Packet (acknowledge)

Sync

Token Packet PID ADDR ENDP CRC5 EOP

Data

Data Packet Sync PID CRC16 EOP

Sync

Handshake Packet PID EOP

Frame Number

Start of Frame Sync PID CRC5 EOP

(4)

USB functions provide a capability

Printer, Thumb Drive, Scanner, Modem or your 9S12.

Endpoints are sources or sinks of data (buffers within the device)

Host can send data to an endpoint

Device puts data in endpoint, but it is not transferred until host requests it

Host

USB (Addr,Endpoint,Direction)

Device

Addr=2 EP0 In EP0 Out EP1 In EP1 Out

Function

Device

Addr=3 EP0 In EP0 Out EP1 In EP1 Out

Function

EP.. Out EP.. In

Figure 14.34. USB data flow model.

pipe is a logical connection between the host and endpoint(s).

how much bandwidth

what transfer type (Control, Bulk, Iso or Interrupt)

direction of data flow

maximum packet/buffer sizes

Stream Pipes can be used send unformatted data.

Data flows sequentially

pre-defined direction, either in or out.

bulk, isochronous and interrupt transfer types

controlled by the host or device

Message Pipes have a

defined USB format

host-controlled

Data is then transferred in the desired direction

support control transfers.

(5)

USB-to-Serial Converter USB Port USB driver COM driver Personal Computer User Program SCI driver Embedded System User Program SCI Port USB USB Port USB driver Personal Computer User Program Embedded System User Program USB Parallel Interface Module I/O Port

Figure 14.35. Modular approach to USB interfacing.

14.7.2. Modular USB interface

USB-to-serial converters

IOGear

Inc.

http://www.iogear.com

Wyse

Technology

http://www.wyse.com

D-Link

Corporation http://www.dlink.com

Computer

Peripheral

Sys,

Inc. http://www.cpscom.com

Jo-Dan International, Inc.

http://www.jditech.com

USB parallel interface module.

send and receive data using parallel handshake protocols

Include a USB-enabled interface and receiver/transmit FIFO buffers

more flexible than the serial cable method,

the microcontroller module can be tailored

USB drivers can be tailored

burn PID and VID numbers into EEPROM.

data is unformatted

does not implement high bandwidth bulk transfers

does not negotiate for real-time bandwidth with isochronous data transfers.

Companies that make these modules include

Future Tech. Devices Inter. Ltd.

http://www.ftdichip.com/

ActiveWire,

Inc.

http://www.activewireinc.com

DLP

Design,

Inc.

http://www.dlpdesign.com

Elexol

Pty

Ltd.

http://www.elexol.com

(6)

14.7.3. Integrated USB interface

LM3S5651

Microchip PIC18F2455

FTDI FT245BM

Freescale 9S12UF32

STM32F103

(7)

Similarities of USB and CAN

• Local wired network

• Serial

• Half-duplex

• Differential pair, voltage encoded

• Microcontroller hardware support (built-in I/O functions)

• Short distances (same box, same room)

• Bit stuffing

Differences between USB and CAN

• CAN is distributed, USB is host-controller

• USB bandwidth is higher

• CAN can have more nodes

• USB is powered, CAN is not powered

• USB has negotiated speed, CAN is fixed speed

(8)

References

Related documents

You can connect the Trust Gamer Network Kit to your computer's USB port or USB HUB after installing the 'Trust Gamer Network Kit USB driver'.. Note: If you use a USB HUB, then

The adapter can be connected to a free USB port on your computer after the driver for the Trust BT110 USB Bluetooth Adapter has been installed and the computer has been restarted..

The process of installing the Skybound USB driver needs to be complete any time the unit is plugged into a new USB port (a port not previously used by the Skybound

Following the steps below to install driver of SCM PC-Card USB to IrDA Adapter: 6.1.1 Power on the computers that you will connect the USB to IrDA Adapter.. and make sure the USB

Windows 10 and 8.1, requires no driver installation, simply plug the USB 3.0 to Gigabit Ethernet Adapter into a USB port and the driver will install automatically.. Note: For all

If you are connecting the Cable Modem to your computer using the USB port, follow these instructions to install the USB driver required for Windows 2000.. Instructions for

Even if it is the installation for the second device, please confirm detachments of all devices that use this driver. If you have installed the DENSO WAVE USB-COM Port Driver

• USB Port, USB Cable, Installed drivers for D.O.Tec Update Bridge and the D.O.TEC Remote Port and installed D.O.Update (see also “D.O.TEC USB Serial.. Driver Installation Guide”