28
© 2000 Morgan Kaufman Overheads for Computers as Components I/O devices I/O devices: serial links timers and counters keyboards displays analog I/O

© 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

Embed Size (px)

Citation preview

Page 1: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

I/O devices

I/O devices: serial links timers and counters keyboards displays analog I/O

Page 2: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Timers and counters

Very similar: a timer is incremented by a periodic

signal; a counter is incremented by an

asynchronous, occasional signal.Rollover causes interrupt.

Page 3: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Watchdog timer

Watchdog timer is periodically reset by system timer.

If watchdog is not reset, it generates an interrupt to reset the host.

host CPU watchdogtimer

interrupt

reset

Page 4: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Switch debouncing

A switch must be debounced to multiple contacts caused by eliminate mechanical bouncing:

Page 5: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Encoded keyboard

An array of switches is read by an encoder.

N-key rollover remembers multiple key depressions.

row

Page 6: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

LED

Must use resistor to limit current:

Page 7: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

7-segment LCD display

May use parallel or multiplexed input.

Page 8: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Types of high-resolution display

Cathode ray tube (CRT)Liquid crystal display (LCD)Plasma, etc.

Page 9: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Touchscreen

Includes input and output device.Input device is a two-dimensional

voltmeter:

Page 10: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Touchscreen position sensing

ADC

voltage

Page 11: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Digital-to-analog conversion

Use resistor tree:R

2R

4R

8R

bn

bn-1

bn-2

bn-3

Vout

Page 12: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Flash A/D conversion

N-bit result requires 2n comparators:

encoder

Vin

...

Page 13: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Dual-slope conversion

Use counter to time required to charge/discharge capacitor.

Charging, then discharging eliminates non-linearities.

Vintimer

Page 14: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Sample-and-hold

Required in any A/D:

converterVin

Page 15: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

USB 2.0

Goals: Easy to use. Low cost for consumer devices. Up to 480 Mb/s. Real-time audio, video. Both isochronous and asynchronous

communication.

Page 16: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

USB architecture

host

device

device

device

interconnect

Bus topology.Stack.

Data flow model.Schedule.

Page 17: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Bus tiers

host

function

hub

hub

function

function

function

Tier 1 tier 2 tier 3 tier 4 …. tier 7

Device = {hub, function}

Page 18: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

USB signaling

Speeds: High-speed is 480 Mb/s. Full-speed is 12 Mb/s. Low-speed is 1.5 Mb/s.

Signals: Vbus, Gnd. D+, D-.

Page 19: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

USB power

USB devices can pull a limited amount of power from the bus. May also supply their own power.

System may provide a power-management protocol. Independent of USB.

Page 20: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

USB bus protocol

Polled bus, all transfers initiated by host.

Basic transaction: Host sends token packet:

Type and direction.USB device number.Endpoint number (subdevice).

Data transfer packet. Acknowledge packet.

Page 21: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Robustness

Error detection/correction.Automatic handling of device

attach/detach.Self-recovery in protocol.Streaming data management.Pipes for data management.

Page 22: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

USB pipes

Functions are allocated to data pipes. Pipes limit interference between

functions.Bandwidth is allocated among pipes.Devices must supply buffer memory.

Page 23: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

USB data flow model

Four types of implementation: Device hardware. Client software to

connect to application.

USB system software.

USB host controller (host side system interface).

host device

Client SW

USB systemSW

USB hostcontroller

function

USB logicaldevice

USB businterface

Physicalcommunication

Page 24: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Logical bus topology

Bus appears to be a simple host/device system:

host

devicedevice

device

Page 25: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Client software view

Each client sees its own function but not the whole system:

function

Client SW

function

Client SW

function

Client SWfunction

Client SW

Page 26: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Endpoints

Each logical device is a collection of endpoints.

Each endpoint is simplex (input or output).Endpoint description:

Bus frequency/latency. Bandwidth requirement. Endpoint number. Error handling requirements. Maximum packet size. Transfer type. Transfer direction.

Page 27: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Pipes

Two types of pipes: Stream. Message.

Pipe description includes: Pipe type. Direction. Bus access and bandwidth.

Page 28: © 2000 Morgan Kaufman Overheads for Computers as Components I/O devices zI/O devices: yserial links ytimers and counters ykeyboards ydisplays yanalog I/O

© 2000 Morgan Kaufman

Overheads for Computers as Components

Bus transfer types

Data goes through the pipe in FIFO order.

Four types of transfers: Control. Isochronous—periodic data stream. Interrupt. Bulk—non-periodic, large data transfer.