Communication
Communication
Communication
5BasicComponents
Every communication system has 5 basic requirements Data Source (where the data originates) Transmitter (device used to transmit data) Transmission Medium (cables or non cable) Receiver (device used to receive data) Destination (where the data will be placed)
TransmissionMediaSpeed
Bandwidth The amount of data which ca be a d dt e a ou t o c can
:
transmitted on a medium over a fixed amount of time (second). It is measured on Bits per Second or Baud
SynchronousVs AsynchronousTransmissions
Synchronous T S h Transmission i i
all data sent at once and no packet switching
Asynchronous Transmission y
Uses stop/ start bits yp most common type of serial data transfer Allows sharing of bandwidth (i.e. talk on phone p g ) while another person is using internet)
TransmissionDirection
simplex: One direction only
Transmission Direction
TransmissionMedia
twisted pair telephone cable twistedpair telephonecable coaxialcableThickblackcableusedforhigher bandwidthcommunicationsthantwistedpair bandwidth communications than twisted pair fibreoptic datatransferredthroughpulsesof light.Extremelyfast. li ht E t l f t Noncablemethodssuchassatelite, microwave,wirelessandbluetooth
Errordetectionandcorrection
Oftenpartofbusprotocol Errordetection:abilityofreceivertodetecterrorsduringtransmission Errorcorrection:abilityofreceiverandtransmittertocooperatetocorrect problem
Typicallydonebyacknowledgement/retransmissionprotocol
Checksum:extrawordsentwithdatapacketofmultiplewords
e.g.,extrawordcontainsXORsumofalldatawordsinpacket
Basicsofserialcommunication
Parallel: expensive - short distance fast no modulation Serial :cheaper long (two different cities by modem)-slow
Sender transmitted
Receiver received
Synchronous:
lowoverhead(longframes) highrates l lesspronetoerrors t
ParallelTransmission
-each bit has its own piece of wire along which it travels - often used to send data to a printer
0 0 1 1 0 0 1
Contents
Introduction Introduction Bus Protocol AMBA BUS I2C BUS CAN BUS CAN
Whatisabus?
ABusIs: sharedcommunicationlink shared communication link singlesetofwiresusedtoconnectmultiplesubsystems
Processor Input Control Memory Datapath Output
Busses
AdvantagesofBuses
Processer
I/O Device
I/O Device
I/O Device
Memory
Versatility:
Newdevicescanbeaddedeasily P i h l Peripheralscanbemovedbetweencomputer b db systemsthatusethesamebusstandard
LowCost:
Asinglesetofwiresissharedinmultipleways
DisadvantageofBuses
Processor
I/O Device
I/O Device
I/O Device
Memory
Itcreatesacommunicationbottleneck
ThebandwidthofthatbuscanlimitthemaximumI/Othroughput
Themaximumbusspeedislargelylimitedby:
Thelength ofthebus h l h f h b Thenumber ofdevicesonthebus Theneedtosupportarangeofdeviceswith: Widelyvaryinglatencies Widelyvaryingdatatransferrates
Highercost,bulky g , y
24
25
GeneralOrganizationofaBus
Control Lines Data Lines
Controllines:
Signalrequestsandacknowledgments I di t h t t Indicatewhattypeofinformationisonthedatalines fi f ti i th d t li
Datalinescarryinformationbetweenthe sourceandthedestination: d th d ti ti
DataandAddresses Complexcommands p
MasterversusSlave
Master issues command Bus Master Data can go either way Bus Slave
Abustransactionincludestwoparts: b l d
Issuingthecommand(andaddress) request Transferring the data Transferringthedata action
Master istheonewhostartsthebustransactionby:
issuingthecommand (andaddress)
Slave istheonewhorespondstotheaddressby:
Sendingdatatothemasterifthemasteraskfordata Receivingdatafromthemasterifthemasterwantstosenddata
SynchronousandAsynchronousBus
SynchronousBus:
Includesaclock inthecontrollines Afixedprotocolforcommunicationthatisrelativetotheclock Advantage: involvesverylittlelogicandcanrunveryfast g y g y Disadvantages: Everydeviceonthebusmustrunatthesameclockrate To avoid clock skew they cannot be long if they are fast Toavoidclockskew,theycannotbelongiftheyarefast
AsynchronousBus:
It is not clocked Itisnotclocked Itcanaccommodateawiderangeofdevices Itcanbelengthenedwithoutworryingaboutclockskew Itrequiresahandshakingprotocol
Bussessofar
Master Slave
BusMaster:hasabilitytocontrolthebus,initiates Bus Master: has ability to control the bus, initiates transaction BusSlave:moduleactivatedbythetransaction BusCommunicationProtocol:specificationofsequenceof eventsandtimingrequirementsintransferring information.
BusTransaction
A bit ti Arbitration: Request: Action: Whogetsthebus Wh t th b Whatdowewanttodo Whathappensinresponse
Oneofthemostimportantissuesinbusdesign:
How is the bus reserved by a device that wishes to use it? Howisthebusreservedbyadevicethatwishestouseit?
Chaosisavoidedbyamasterslavearrangement:
Only the bus master can control access to the bus: Onlythebusmastercancontrolaccesstothebus: Itinitiatesandcontrolsallbusrequests Aslaverespondstoreadandwriterequests p q
BusArbitration
Whenmore thanonedevicewantstobethebus master,weneedsomebusarbitration mechanismtopreventchaos. Acentralized arbitrationschemerequiresa dedicatedbusarbiter,whodetermineswhich deviceisthebusmasternext;hence,every deviceconnectstothebusarbiterwithone(or more)busrequestandone(ormore)busgrant lines.
Busarbitrationschemesusuallytrytobalancetwofactors:
Bus priority: the highest priority device should be serviced first Buspriority:thehighestprioritydeviceshouldbeservicedfirst Fairness:Eventhelowestprioritydeviceshouldnever becompletelylockedoutfromthebus
Advantage:simple Disadvantages:
Cannotassurefairness: Alowprioritydevicemaybelockedoutindefinitely Theuseofthedaisychaingrantsignalalsolimitsthebusspeed f
CentralizedParallelArbitration
Device 1 Device D i 2 Device N
Req
Usedinessentiallyallprocessormemorybusses y p y andinhighspeedI/Obusses
IncreasingtheBusBandwidth
Separateversusmultiplexedaddressanddatalines:
Addressanddatacanbetransmittedinonebuscycle ifseparateaddressanddatalinesareavailable Cost: (a) more bus lines (b) increased complexity Cost:(a)morebuslines,(b)increasedcomplexity
DMA controller
Peripheral bus
39
Microprocessor
Cache
Memory controller
DMA controller
Peripheral bus
40
Bridge
A Bridge is a slave on the fast bus and master ABridgeisaslave onthefastbusandmaster oftheslowbus Takes command from the fast bus on which it Takescommandfromthefastbusonwhichit isslave I Issuescommandsontheslowbus d h l b Returnsresultsfromslowbustofastbus Alsofunctionsasprotocoltranslator
41
AMBA
AdvancedMicrocontroller BusArchitecture
TheSystemonaChip
System Bus
DMA CPU DSP
Bridge
MPEG
Systemonachip (SOC)requiresbusing (SOC) requires busing systemstoconnect variouscomponents, includingoneormore microprocessors, memories,peripherals ,p p andspeciallogic.
AMBASpecification
AMBA: Advanced Microcontroller Bus Architecture A hit t Created by ARM to enable standardized interfaces to their embedded processors Actually three standards: APB, AHB, and AXI Very commonly used for commercial IP cores
45
AMBASpecification p
AMBA: Advanced Microcontroller Bus Architecture A hit t Created by ARM to enable standardized interfaces to their embedded processors
Simple Bus
Actually three standards: APB, AHB, and ASB Very commonly used for commercial IP cores
46
AMBASpecification
AMBA: Advanced Microcontroller Bus Architecture A hit t Created by ARM to enable standardized interfaces to their embedded processors
Simple Bus Complex Bus
Actually three standards: APB, AHB, Very commonly used for commercial IP cores
47
AMBASpecification
AMBA: Advanced Microcontroller Bus Architecture A hit t Created by ARM to enable standardized interfaces to their embedded processors
Simple Bus Complex Bus
Actually three standards: APB, AHB, AHB: Advanced high Speed Bus APB: Advanced Peripheral Bus Very commonly used for commercial IP cores
48
AMBAAHB
49
RB - 2003/2005
50
AMBA2.0SystemLevelView
AdvancedHighperformanceBus (AHB)
TheAMBAAHBisforhighperformance,highclock frequencysystemmodules. TheAHBactsasthehighperformancesystem backbone bus. AHBsupportstheefficientconnectionofprocessors, onchipmemories andoffchipexternalmemory hi i d ff hi l Interfaceswithlowpowerperipheralmacrocell functions. f ti AHBisalsospecifiedtoensureeaseofuseinan efficientdesignflowusingsynthesisandautomated efficient design flow using synthesis and automated test techniques.
RB - 2003/2005
52
AdvancedSystemBus (ASB)
The AMBA ASB is for highperformance system TheAMBAASBisforhigh performancesystem modules. AMBAASBisanalternativesystembussuitablefor y usewherethehighperformance featuresofAHBare notrequired. ASBalsosupportstheefficientconnectionof processors,onchipmemoriesandoffchipexternal memoryinterfaceswithlowpower peripheral f hl h l macrocellfunctions.
RB - 2003/2005
53
AdvancedPeripheralBus (APB)
The AMBA APB is for lowpower peripherals TheAMBAAPB isforlow powerperipherals. AMBAAPBisoptimizedforminimalpower consumption and reduced interface andreducedinterface complexity tosupportperipheralfunctions. APBcanbeusedinconjunctionwitheither APB can be used in conjunction with either versionofthesystembus.
RB - 2003/2005
54
ObjectivesoftheAMBAspecification j p
The AMBA specification has been derived to satisfy TheAMBAspecificationhasbeenderivedtosatisfy fourkeyrequirements:
tofacilitatetherightfirsttime developmentofembedded microcontroller productswithoneormoreCPUsorsignal processors to be technology independent and ensure that highly tobetechnologyindependentandensurethathighly reusable peripheraland systemmacrocellscanbe migratedacrossadiverserangeofICprocessesandbe appropriateforfullcustom,standardcellandgatearray technologies
RB - 2003/2005
55
ObjectivesoftheAMBAspecification
To encourage modular system design to improve Toencouragemodular systemdesigntoimprove processorindependence, providinga developmentroadmapforadvancedcachedCPU coresandthe developmentofperipherallibraries Tominimizethesiliconinfrastructurerequiredto supportefficientonchipand offchip communicationforbothoperationand manufacturingtest. manufacturing test
RB - 2003/2005
56
I2CBusConfiguration g
2wireserialbus Serialdata(SDA)andSerial clock(SCL) Half duplex,synchronous,multi masterbus Halfduplex, synchronous, multimaster bus Nochipselectorarbitrationlogicrequired
I2CProtocol
clocksignal q 2.Mastersendsaunique7bitslavedeviceaddress 3.Mastersendsread/writebit(R/W) 0 slave receive,1 slavetransmit 4.Receiversendsacknowledgebit(ACK) 4 Receiver sends acknowledge bit (ACK) 5.Transmitter(slaveormaster)transmits1byteof data
the th
I2CProtocol(cont.) ( )
7.Repeat5and6ifmorebytesneedtobetransmitted. 8.a)Forwritetransaction(mastertransmitting),masterissues 8 a) For write transaction (master transmitting) master issues stopcondition(P)afterlastbyteofdata. 8.b)Forreadtransaction(masterreceiving),masterdoesnot acknowledgefinalbyte,justissuesstopcondition(P)totell theslavethetransmissionisdone
I2CSignals
Start high-to-low transition of the SDA line while SCL line is high Stop low-to-high transition of the SDA line while SCL line is high Ack receiver pulls SDA low while transmitter allows it to float high Data transition takes place while SCL is slow, valid while SCL is high
D C
S T A R T A 6 A 5 A 0 R / w A C K D 8 D 7 D 0 A C K S T O P
64
66
USB
Devicescanbedaisychained
DaisyChainingofUSBDevices
USB Connection Device 3
Computer
USB Port
In
Device 2
Device 1
Out
ConnectingUSBDevicesUsinga Hub
USB Connection Device 3
Computer
USB Port
Device 2
In
Hub
Out
SampleUSBDevices
Keyboards Monitors DigitalCameras i i lC DigitalVideRecorders etc.
USBStandards
USB 1 1 USB1.1 USB2.0 USBOnTheGo(OTG) S O h G (O G)
Anewerstandardbeingdesignedforportableand smalldevices ll d
OperatingSystemSupportforUSB
The operating systems such as Windows XP or the TheoperatingsystemssuchasWindowsXPorthe laterversionsofsomeoftheolderoperatingsystems supportUSB
Windows98 Windows95OSR2
InaccordancewithUSBstandards,theseoperating systemssupporthotplugandplayforUSBdevices
HotPlugandPlay
Theabilitytoconnectadevicetothe computerwhileacomputerisinoperation Asthedeviceisconnected,theOSwould:
Recognizethedevice g Configurethedevice
Tieredstartopologycanbeused
O USB d i (h b) OneUSBdevice(hub)connectedtoPC d PC
hubcanbeembeddedindeviceslikemonitor,printer,orkeyboardorcanbestandalone
MultipleUSBdevicescanbeconnectedtohub Upto127devicescanbeconnectedlikethis p
USBhostcontroller
Managesandcontrolsbandwidthanddriversoftwarerequiredbyeachperipheral Dynamicallyallocatespowerdownstreamaccordingtodevices connected/disconnected
FIREWIRE
Serialprotocols:FireWire
HighperformanceserialbusdevelopedbyAppleComputer Inc. Designedforinterfacingindependentelectroniccomponents e.g.,Desktop,scanner e g Desktop scanner Datatransferratesfrom12.5to400Mbits/s,64bitaddressing Plugandplaycapabilities g p y p Packetbasedlayereddesignstructure ApplicationsusingFireWireinclude: diskdrives,printers,scanners,cameras
IEEE1394Standard(FireWire)
I Insomeways,itcompeteswithUSB it t ith USB Bandwidthis400Mbpsor50MBps I h Intheorytherefore,itcanreplaceolderSCSIand h f i l ld SCSI d IDEusedforconnectingharddisks Fi Wi i FireWiresimpactismostlikelytobefeltin ti t lik l t b f lt i multimedia applicationsinvolvingaudio and video Somebasicnetworkingcanbedonethroughthe Firewireportsaswell Firewire ports as well
DataTransmission
100 Mbps 200 Mbps and 400 Mbps 100Mbps,200Mbpsand400Mbps Newerportsarebeingdevelopedtosupport 800Mbpsand1600Mbps 800 Mbps and 1600 Mbps Dataistransmittedinpacketsanditis availabletoallthedevicesonthebus il bl ll h d i h b
TypeofTransmission
Asynchronous(bulk)transfer guarantees correcttransmission;suitableforcontrol dataandwhereerrorfreetransmission takesprecedenceoverspeed. Isochronoustransfer guarantees bandwidth(idealfortransmittingtime criticaldata,e.g.video,audio) ld d d ) Courtesy:www.thesycon.de
AMBA
AdvancedMicrocontroller BusArchitecture
Parallelprotocols:ARMBus
ARMBus
DesignedandusedinternallybyARMCorporation InterfaceswithARMlineofprocessors ManyICdesigncompanieshaveownbusprotocol Datatransferrateisafunctionofclockspeed
IfclockspeedofbusisX,transferrate=16xXbits/s
32bitaddressing
TheSystemonaChip
System Bus
DMA CPU DSP
Bridge
MPEG
Systemonachip (SOC)requiresbusing (SOC) requires busing systemstoconnect variouscomponents, includingoneormore microprocessors, memories,peripherals ,p p andspeciallogic.
AMBASpecification
AMBA: Advanced Microcontroller Bus Architecture A hit t Created by ARM to enable standardized interfaces to their embedded processors Actually three standards: APB, AHB, and AXI Very commonly used for commercial IP cores
86
AMBASpecification p
AMBA: Advanced Microcontroller Bus Architecture A hit t Created by ARM to enable standardized interfaces to their embedded processors
Simple Bus
Actually three standards: APB, AHB, and ASB Very commonly used for commercial IP cores
87
AMBASpecification
AMBA: Advanced Microcontroller Bus Architecture A hit t Created by ARM to enable standardized interfaces to their embedded processors
Simple Bus Complex Bus
Actually three standards: APB, AHB, Very commonly used for commercial IP cores
88
AMBASpecification
AMBA: Advanced Microcontroller Bus Architecture A hit t Created by ARM to enable standardized interfaces to their embedded processors
Simple Bus Complex Bus
Actually three standards: APB, AHB, AHB: Advanced high Speed Bus APB: Advanced Peripheral Bus Very commonly used for commercial IP cores
89
AMBAAHB
90
RB - 2003/2005
91
AMBA2.0SystemLevelView
AdvancedHighperformanceBus (AHB)
TheAMBAAHBisforhighperformance,highclock frequencysystemmodules. TheAHBactsasthehighperformancesystem backbone bus. AHBsupportstheefficientconnectionofprocessors, onchipmemories andoffchipexternalmemory hi i d ff hi l Interfaceswithlowpowerperipheralmacrocell functions. f ti AHBisalsospecifiedtoensureeaseofuseinan efficientdesignflowusingsynthesisandautomated efficient design flow using synthesis and automated test techniques.
93
AdvancedSystemBus (ASB)
The AMBA ASB is for highperformance system TheAMBAASBisforhigh performancesystem modules. AMBAASBisanalternativesystembussuitablefor y usewherethehighperformance featuresofAHBare notrequired. ASBalsosupportstheefficientconnectionof processors,onchipmemoriesandoffchipexternal memoryinterfaceswithlowpower peripheral f hl h l macrocellfunctions.
94
AdvancedPeripheralBus (APB)
The AMBA APB is for lowpower peripherals TheAMBAAPB isforlow powerperipherals. AMBAAPBisoptimizedforminimalpower consumption and reduced interface andreducedinterface complexity tosupportperipheralfunctions. APBcanbeusedinconjunctionwitheither APB can be used in conjunction with either versionofthesystembus.
95
Serialprotocols:I2C
I2C(InterIntegratedCircuit)
TwowireserialbusprotocoldevelopedbyPhilipsSemiconductorsnearly 20yearsago EnablesperipheralICstocommunicateusingsimplecommunication p p g p hardware Datatransferratesupto100kbits/sand7bitaddressingpossiblein normalmode 3.4Mbits/sand10bitaddressinginfastmode CommondevicescapableofinterfacingtoI2Cbus:
EPROMS Flash and some RAM memory realtime clocks watchdog timers EPROMS,Flash,andsomeRAMmemory,realtimeclocks,watchdogtimers, andmicrocontrollers
I2Cbusstructure
SCL SDA Micro-controller (master) EEPROM (servant) Temp. Sensor (servant) LCD-controller (servant) < 400 pF Addr=0x01 Addr=0x02 Addr=0x03
SDA
SDA
SDA
SDA
SCL Sending 0
D C
S T
A R T
A 6
A 5
A 0
Typical read/write cycle
R / w
A C K
D 8
D 7
D 0
A C K
S T
O P
Serialprotocols:CAN
CAN(Controllerareanetwork) Protocolforrealtimeapplications DevelopedbyRobertBoschGmbH O i i ll f Originallyforcommunicationamongcomponentsofcars i i f ApplicationsnowusingCANinclude: elevator controllers copiers telescopes production line elevatorcontrollers,copiers,telescopes,productionline controlsystems,andmedicalinstruments Datatransferratesupto1Mbit/sand11bitaddressing CommondevicesinterfacingwithCAN: 8051compatible8592processorandstandaloneCAN controllers t ll
Parallelprotocols:PCIBus
PCIBus(PeripheralComponentInterconnect)
HighperformancebusoriginatedatIntelintheearly1990s StandardadoptedbyindustryandadministeredbyPCISIG(PCISpecialInterest Group) Interconnectschips,expansionboards,processormemorysubsystems Datatransferratesof127.2to508.6Mbits/sand32bitaddressing
Laterextendedto64bitwhilemaintainingcompatibilitywith32bitschemes
Synchronousbusarchitecture Multiplexeddata/addresslines
Wirelessprotocols:Bluetooth
Bluetooth
New,globalstandardforwirelessconnectivity Basedonlowcost,shortrangeradiolink Connectionestablishedwhenwithin10metersofeachother Nolineofsightrequired
e.g.,Connecttoprinterinanotherroom
Wirelesscommunication
Infrared(IR) ( )
Electronicwavefrequenciesjustbelowvisiblelightspectrum Diodeemitsinfraredlighttogeneratesignal Infrared transistor detects signal conducts when exposed to infrared Infraredtransistordetectssignal,conductswhenexposedtoinfrared light Cheaptobuild Need lineofsight,limitedrange
Radiofrequency(RF)
El t Electromagneticwavefrequenciesinradiospectrum ti f i i di t Analogcircuitryandantennaneededonbothsidesoftransmission Lineofsightnotneeded,transmitterpowerdeterminesrange
Wirelessprotocols:IrDA
IrDA
Protocolsuitethatsupportsshortrangepointtopointinfrareddata transmission Created and promoted by the Infrared Data Association (IrDA) CreatedandpromotedbytheInfraredDataAssociation(IrDA) Datatransferrateof9.6kbpsand4Mbps IrDAhardwaredeployedinnotebookcomputers,printers,PDAs,digital cameras,publicphones,cellphones cameras public phones cell phones Lackofsuitabledrivershasslowedusebyapplications Windows2000/98nowincludesupport BecomingavailableonpopularembeddedOSs
WirelessProtocols:IEEE802.11
IEEE802.11
ProposedstandardforwirelessLANs SpecifiesparametersforPHYandMAClayersofnetwork
PHY layer PHYlayer
physicallayer handlestransmissionofdatabetweennodes p provisionsfordatatransferratesof1or2Mbps p operatesin2.4to2.4835GHzfrequencyband(RF) or300to428,000GHz(IR)
MAClayer
mediumaccesscontrollayer protocolresponsibleformaintainingorderinsharedmedium collisionavoidance/detection
ChapterSummary
Basicprotocolconcepts
Actors,direction,timemultiplexing,controlmethods
Generalpurposeprocessors
PortbasedorbusbasedI/O I/Oaddressing:MemorymappedI/OorStandardI/O / / / Interrupthandling:fixedorvectored Directmemoryaccess
Arbitration
Priorityarbiter(fixed/rotating)ordaisychain