41
Setha Pan-ngum

Embedded System Communication

Embed Size (px)

DESCRIPTION

Embed Comm

Citation preview

Page 1: Embedded System Communication

Setha Pan-ngum

Page 2: Embedded System Communication

IntroductionEmbedded & Real-time systems could be

standalone or connectedA real-time system is often composed from a

number of periodic (time triggered) and sporadic (event triggered) tasks which communicate their result by passing messages.

In a distributed real-time systems these messages are sometimes sent between processors across a communication device. (from Urban Bilstrup)

Page 3: Embedded System Communication

Introduction (cont.)To guarantee that the timing requirements of

all tasks are met, the communications delay between a sending task and a receiving task being able to access that message must be bounded.

For examples Control systems: between sensors and

actuators via central computer Multiprocessors: between processors, tasks

communicating

Page 4: Embedded System Communication

Open System Interconnection•Intended for computers

•Designed to solve compatibility problem

•Layers provide standard interface and services

•Embedded systems use some standardisation ideas

•Higher layers require lower layers to work

Page 5: Embedded System Communication

OSILayersApplication – user interface e.g. Internet explorerPresentation – data formatting e.g. compression

and encodingSession – handle overall connection e.g. OS,

scheduling programsTransport – ensures data transfer, error checking

e.g. TCPNetwork – logical addressing, routing e.g. IP

(from TCP/IP)

Page 6: Embedded System Communication

OSI cont.Data link – prepares data for transfer,

physical addressing such as Media Access Control (MAC)

Physical – wires and cables, hubs, repeaters.

Page 7: Embedded System Communication

Embedded CommunicationPoint-to-point networks

Each node connected to every nodeSimple and reliableDedicated links make it easy to meet real-time

deadlinesCostly due to many wires required

Shared media networksNodes are connected via bus or other topologiesLess wiring and hence cheaperEasily extendable by adding new nodes to networkComplex network protocolBeing the system of focus from now on

Page 8: Embedded System Communication

Basic network architectures

P1 P2

P3 P4

P1 P2

P3 P4

P1 P2

P3 P4

memory Internet

P1 P2

P3 P4

From Urban Bilstrup

Page 9: Embedded System Communication

Complex distributed architecture

HMI

Tuners Playback

External Wireless Communication System

Audio modulesAudio modules

Audio modulesAudio module

GatewayMOST

GREEN CANInternal Wireless Communication System

RED CAN

LIN

From Urban Bilstrup

Page 10: Embedded System Communication

ConceptsEvent based communication

E.g. alarm, user inputs, requests for data from other systems

State based communicationE.g. regular sensor readingsPredictability

Page 11: Embedded System Communication

Network resources & qualitative parametersNetwork resources

BandwidthBuffer spaceProtocol efficiency (data bits/bandwidth).

Depends on Message overhead Media access overhead

Determinacy (ability to calculate worst-case response time)

Robustnesscost

Page 12: Embedded System Communication

Event based systemEfficient use of network resourceNeeds high reliability (event based data

comes once in a while) May need acknowledgementHard to predict delay in case of overloading

(e.g. alarm)

Page 13: Embedded System Communication

State based systemMessages sent at predefined, regular

intervals.Less efficient due to regular occupation of

communication channel by nodes.More tolerance. Missed message may be ok,

since the next one will be coming.Transient data problem. Sending node has to

keep data long enough for other to see. E.g. button pressed may need to be repeated.

Page 14: Embedded System Communication

Protocol No best protocol, depends on applications.Embedded systems tends to focus on level 1

and 2 of OSI model, for simplicity and overhead reduction.

Physical link (Layer 1) – transmission mediumData link (Layer 2) provides Media Access

Control (MAC)

Page 15: Embedded System Communication

15

Advanced communication principles [6]Layering

Break complexity of communication protocol into pieces easier to design and understand

Lower levels provide services to higher level Lower level might work with bits while higher level might work with

packets of data Physical layer

Lowest level in hierarchy Medium to carry data from one actor (device or node) to another

Parallel communication Physical layer capable of transporting multiple bits of data

Serial communication Physical layer transports one bit of data at a time

Wireless communication No physical connection needed for transport at physical layer

Page 16: Embedded System Communication

16

Parallel communication [6]Multiple data, control, and possibly power wires

One bit per wire

High data throughput with short distancesTypically used when connecting devices on same

IC or same circuit boardBus must be kept short

long parallel wires result in high capacitance values which requires more time to charge/discharge

Data misalignment between wires increases as length increases

Higher cost, bulky

Page 17: Embedded System Communication

17

Serial communication [6]Single data wire, possibly also control and power

wiresWords transmitted one bit at a timeHigher data throughput with long distances

Less average capacitance, so more bits per unit of time

Cheaper, less bulkyMore complex interfacing logic and communication

protocolSender needs to decompose word into bitsReceiver needs to recompose bits into wordControl signals often sent on same wire as data increasing

protocol complexity

Page 18: Embedded System Communication

18

Wireless communication [6]Infrared (IR)

Electronic wave frequencies just below visible light spectrumDiode emits infrared light to generate signal Infrared transistor detects signal, conducts when exposed to

infrared lightCheap to buildNeed line of sight, limited range

Radio frequency (RF)Electromagnetic wave frequencies in radio spectrumAnalog circuitry and antenna needed on both sides of

transmissionLine of sight not needed, transmitter power determines

range

Page 19: Embedded System Communication

Media Access Control (MAC)Many protocols are taken from computer

networks

Connection oriented protocolsCSMA/CDCSMA/CAPollingToken passingTDMABinary countdown (Bit dominance)

Page 20: Embedded System Communication

Protocol overview [1]

Page 21: Embedded System Communication

Connection oriented protocols [5]

2 nodes per each connection onlyIf nodes are not directly connected, data is relayedDeterministic delay between directly connected

nodes, high delay for indirectly connected nodes

Page 22: Embedded System Communication

Connection oriented protocols cont.Suitable to systems with low communication

requirements.Node with pass-through traffic can be fully

occupied.E.g. telephone network service

Page 23: Embedded System Communication

Polling [5]

Simple and deterministicNeeds a master nodeMaster periodically polls slave nodesConsumes bandwidthE.g. military aircraft communicationSimple slave nodes, complex master

Page 24: Embedded System Communication

Time Division Multiple Access (TDMA) [5]

Masters broadcasts sync signal to synchronise all clocks

Then each node sends data on its time slot.Similar but more efficient than polling (synchronise

once vs polling all nodes individually.more complex nodes due to timing requirements.

Page 25: Embedded System Communication

TDMA cont.Fixed length messages (inflexible) E.g. satellite communications

Page 26: Embedded System Communication

Token ring [5]

Ring shape networkToken (signal) is passed from node to nodeNode can hold token, send message all the

way round the ring, and pass token onDeterministic under heavy load

.

Page 27: Embedded System Communication

Token ring cont.Some token overheadCan add priority by having extra field in

tokenMore complexity in detecting token lostCable break disrupts network (needs dual

ring)E.g. many Wide Area Networks (WANs)

Page 28: Embedded System Communication

Token bus [5]

Similar to token ringToken is passed via bus simultaneously Cable break can be dealt with by

reconfiguration (like when a node is added to or taken off the network.

Applied in manufacturing

Page 29: Embedded System Communication

Binary countdown (Bit Dominance)All nodes wait for channel to be free before sending. Simultaneous channel access (contention) resolved by

detecting broadcasting signal for unique identificationBus must provide dominance bit e.g. ‘1’ can override

‘0’ A node stop transmitting when seeing dominance bit

opposite to its own broadcasting.Hence messages require priority as IDs rather than

node IDs.Good throughput & high efficiency (no contention

loss)

Page 30: Embedded System Communication

Binary countdown cont. [5]

Page 31: Embedded System Communication

Binary countdown cont. Heavy load can cause long delay for low

priority messages (no bound)Applied in industrial and automotive

Controller Area Network (CAN) and SAE standard J 1850

Page 32: Embedded System Communication

Carrier Sense Multiple Access with Collision Dectection (CSMA/CD) [5]

Nodes wait for idle channel before transmitting.

When simultaneously transmission is detected, each node stops and waits for random time before resending.

Page 33: Embedded System Communication

CSMA/CD cont.Easy to add or take off new nodes without

initialisation and configurationLow overhead at light trafficUnbound overhead at heavy traffic (messages

keeps colliding) hence low determinacy and efficiency.

Requires detection circuit

Page 34: Embedded System Communication

Carrier Sense Multiple Access with Collision Avoidance (SCMA/CA) [5]

Page 35: Embedded System Communication

CSMA/CA cont.Hybrid between light traffic efficiency of

CSMA/CA and heavy traffic efficiency of token-based protocols.

Nodes waits for free network before sending. When collision happens, jam signal is sent to

notify all nodes, synchronises clocks and start contention time slot.

Unique time slot is assigned to each nodeRotate time slot for fairnessNetwork return to normal state when all slots are

unused.

Page 36: Embedded System Communication

CSMA/CA cont.Variations

Reservation CSMA – no. of slots equal to no. of nodes Not practical if networks has many nodes.

No. of slots less than no. of nodes – randomly allocate slots to nodes.

Page 37: Embedded System Communication

Media access comparison [5]

Page 38: Embedded System Communication

Automotive standards [7]Controller Area Network (CAN)

Event triggered, Arbitration

Time Triggered Protocol (TTP) Time triggered, TDMA

Local Interconnect Network (LIN) Time triggered, master-slave

Media Oriented System Transport (MOST)

Page 39: Embedded System Communication

Manufacturing Automation Standards [7]

Controller Area Network (CAN) Arbitration

Process Network (P-NET) Token passing and master-slave

PROcess Field Bus (PROFIBUS) Token passing and master-slave

Factory Instrumentation Protocol (World FIP) Centralised arbitration

Page 40: Embedded System Communication

Military Standards [7]MIL-STD 1553

The current 1553 data bus is widely used in military applications, with a nominal throughput of 1 Mb/s.

MIL-STD 1773 Mil-Std-1773 defines a fiber optic bus. This system is widely

used for on-board command and telemetry transfer between military spacecraft components, subsystems and instruments, and within complex components themselves. 1773 AS, has a dual rate of 1 Mb/s or 20 Mb/s.

ARINC 429 A commercial aircraft data bus. It is widely implemented in

the commercial aircraft avionics industry. Performance is 100Kb/s or 12.5Kb/s.

Page 41: Embedded System Communication

References1. Upender B, Koopman P, Embedded communication

protocol options, Proc. to the 5th annual embbeded system conference, 1993

2. Rollins L, Embedded communication3. Kopetz H, Real-time system design principles for

distributed embedded applications, Kluver, 19974. Liu J, Real-time systems, Prentice-Hall, 20005. Upender B, Koopman P, Communication protocols for

embedded systems, Embedded systems programming, Nov 1994.

6. Vahid F, Givargis T, Embedded system design a unified hardware/software introduction, Wiley, 2002

7. Bilstrup U, Real-time communication