Early Serial CommunicationLater Serial CommunicationRS-232RS-232 SignalsReceiving RS-232VariantsBaud RatePhysical VariantsThe I$^ extrm {2}$C BusI$^ extrm {2}$C Bus TransactionUSB: Universal Serial BusUSB ConnectorsUSB signalingUSB PacketsUSB Bus ProtocolUSB Data Flow TypesLayered ArchitectureUSB: Flash Card DeviceUSB: Mouse DevicePhilips ISP1362 USB 2.0 ControllerPhilips ISP1362 USB 2.0 ControllerSerial CommunicationsProf. Stephen A. [email protected] UniversitySpring 2007Serial Communications – p. 1/22Early Serial CommunicationSerial Communications – p. 2/22Later Serial CommunicationData Terminal EquipmentDataCommunicationsEquipmentSerial Communications – p. 3/22RS-232Defined in early 1960sSerial, Asynchronous, Full-duplex,Voltage-based, point-to-point, 100 ft+ cables+12V+3VSPACE = 0−3V−12VMARK = 1TxHHHLLVVVVVVVVVVVVVVVVÆHHHIdleStart LSB B1 B2B3B4B5 B6MSBStopSerial Communications – p. 4/22RS-232 SignalsSignal DB-9 DTE ... Meaningpin DCERxD 2 ← Data received by DTETxD 3 → Data sent by DTESG 5 — GroundDSR 6 ← Data Set Ready (I’m alive)DTR 4 → Data Terminal Ready (me, too)DCD 1 ← Carrier Detect (hear a carrier)RTS 7 → Request To Send (Yo?)CTS 8 ← Clear To Send (Yo!)RI 9 ← Ring IndicatorSerial Communications – p. 5/22Receiving RS-232RxHHHLLVVVVVVVVVVVVVVVVÆHHHIdleStart LSB B1 B2B3B4B5 B6MSBStopRxHHLLLLLLLLLLLLLLVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV4×ClkL HStartSample Sample SampleMost UARTs actually use 16× clocksSerial Communications – p. 6/22VariantsParity bit: (Even = true when even number of 1s)TxHHHLLVVVVVVVVVVVVVVVVÆHHHIdleStart LSB B1 B2B3B4B5 B6ParityStopTwo stop bits:TxHHHLLVVVVVVVVVVVVVVVVÆHHHHHHHIdleStart LSB B1 B2B3B4B5 B6MSBStop StopSerial Communications – p. 7/22Baud RateBaud: bits per secondBaud Application110 ASR-33 Teletype300 Early acoustic modems1200 Direct-coupled modems c. 19802400 Modems c. 19909600 Serial terminals1920038400 Typical maximumSerial Communications – p. 8/22Physical VariantsConnectors: DB-25, DB-9, Mini DIN-8RS-422: Differential signaling RS-485: Bus-likeSerial Communications – p. 9/22The I2C BusPhilips invented the Inter-IC bus c. 1980 as a verycheap way to communicate slowly among chipsE.g., good for setting control registers100, 400, and 3400 kHz bitratesSCL: Clock, generated by a single masterSDA: Data, controlled by either master or slavesSerial Communications – p. 10/22I2C Bus TransactionSCLSDAHHHHHH-HHHL-LL-LL-LLHH-HHHHHHHHHHHH-HLLL-LLLLLL-HH-LLLLLL-LLHHIdleStart“0”“1”AckStopSerial Communications – p. 11/22USB: Universal Serial Bus1.5 Mbps, 12 Mbps, and 480 Mbps (USB 2.0)Point-to-point, differential, twisted pair3–5m maximum cable lengthSerial Communications – p. 12/22USB ConnectorsSerial Communications – p. 13/22USB signalingNRZI: 0 = toggle, 1 = no changeBit stuffing: 0 automatically inserted after sixconsecutive 1sEach packet prefixed by a SYNC field: 3 0sfollowed by two 1sLow- vs. full-speed devices identified by differentpull-ups on D+/D- linesSerial Communications – p. 14/22USB PacketsAlways start with SYNCThen 4-bit type, 4-bit type complemented2 bits distinguish Token, Data, Handshake, andSpecial, other two bits select sub-typesThen data, depending on packet typeData checked using a CRCAddresses (1-128) assigned by bus master, eachwith 16 possible endpointsSerial Communications – p. 15/22USB Bus ProtocolPolled bus: host initiates all transfers.Most transactions involve three packets:“Token” packet from host requesting dataData packet from targetAcknowledge from hostSupports both streams of bytes and structuredmessages (e.g., control changes).Serial Communications – p. 16/22USB Data Flow TypesControlFor configuration, etc.Bulk DataArbitrary data stream: burstyInterrupt DataTimely, reliable delivery of data. Usuallyevents.Isochronous DataFor streaming real-time transfer:prenegotiated bandwidth and latencySerial Communications – p. 17/22Layered ArchitectureSerial Communications – p. 18/22USB: Flash Card DeviceBus 001 Device 002: ID 05e3:0760 Genesys Logic, Inc.bcdUSB 2.00bMaxPacketSize0 64idVendor 0x05e3 Genesys Logic, Inc.idProduct 0x0760bcdDevice 1.14iManufacturer 2 GenesysiProduct 3 Flash ReaderiSerial 4 002364Configuration Descriptor:bNumInterfaces 1MaxPower 300mAInterface Descriptor:bNumEndpoints 2bInterfaceClass 8 Mass StoragebInterfaceSubClass 6 SCSIbInterfaceProtocol 80 Bulk (Zip)Endpoint Descriptor:bEndpointAddress 0x81 EP 1 INbmAttributes 2Transfer Type BulkSynch Type nonewMaxPacketSize 64Endpoint Descriptor:bLength 7bDescriptorType 5bEndpointAddress 0x02 EP 2 OUTbmAttributes 2Transfer Type BulkSynch Type nonewMaxPacketSize 64Language IDs: (length=4)0409 English(US)Serial Communications – p. 19/22USB: Mouse DeviceBus 002 Device 002: ID 04b4:0001 Cypress Semiconductor MouseDevice Descriptor:bcdUSB 1.00idVendor 0x04b4 Cypress SemiconductoridProduct 0x0001 MousebcdDevice 4.90iManufacturer 1 Adomax Sem.iProduct 2 USB MouseiSerial 0Configuration Descriptor:bNumInterfaces 1bmAttributes 0xa0Remote WakeupMaxPower 100mAInterface Descriptor:bNumEndpoints 1bInterfaceClass 3 Human Interface DevicesbInterfaceSubClass 1 Boot Interface SubclassbInterfaceProtocol 2 MouseiInterface 5 EndPoint1 Interrupt PipeHID Device Descriptor:bDescriptorType 34 ReportwDescriptorLength 52Endpoint Descriptor:bEndpointAddress 0x81 EP 1 INbmAttributes 3Transfer Type InterruptSynch Type nonewMaxPacketSize 4bInterval 10Language IDs: (length=4)0409 English(US)Serial Communications – p. 20/22Philips ISP1362 USB 2.0 ControllerSerial Communications – p. 21/22Philips ISP1362 USB 2.0 ControllerOn the DE2, one downstream port, one hostOperates at 12 or 480 Mbps speedsTwo control endpoints + 14 user endpoints4096 (host) + 2462 (device) bytes buffer memorySupports DMA data transfersMany configuration and status registers150-page data “sheet” + 99-page embeddedprogramming guideSerial Communications – p.
View Full Document