Sunteți pe pagina 1din 86

Embedded System

Communication
UNIT - 2
Embedded system functionality aspects
▪ Processing
▪ Transformation of data
▪ Implemented using processors

▪ Storage
▪ Retention of data
▪ Implemented using memory

▪ Communication
▪ Transfer of data between processors and memories
▪ Implemented using buses
▪ Called interfacing

2
Classification of Embedded Systems
TYPES OF EMBEDDED
SYSTEM

BASED ON PERFORMANCE AND BASED ON PERFORMANCE OF


FUNCTIONAL REQUIREMENTS MICROCONTROLLER

SMALL
REAL SCALE
TIME

MEDIUM
STAND SCALE
ALONE
MOBILE
NETWORKED
SOPHISTICATED
02-Nov-19 3
BASED ON PERFORMANCE AND FUNCTIONAL REQUIREMENT

1. REAL TIME EMBEDDED SYSTEMS

❑ Real-time embedded systems are defined as those systems in which the


correctness of at which the results are produced.
❑ Hard real-time systems
(e.g., Avionic control).
❑ Firm real-time systems
(e.g., Banking).
❑ Soft real-time systems
(e.g., Video on demand).

November 2, 2019 4
2. STAND ALONE EMBEDDED SYSTEMS

▪ A standalone device is able to function independently of other hardware.


This means it is not integrated into another device.
▪ It takes the input from the input ports either analog or digital and
processes, calculates and converts the data and gives the resulting data
through the connected device-Which either controls, drives and displays the
connected devices.
▪ For example, a TiVo box that can record television programs , mp3 players
are standalone devices

5
3. NETWORKED EMBEDDED SYSTEMS

▪ These types of embedded systems are related to a network


to access the resources.

▪ The connected network can be LAN, WAN, CAN or the


internet.

▪ The connection can be any wired or wireless.

▪ This type of embedded system is the fastest growing area in


embedded system applications.

November 2, 2019 6
4. MOBILE EMBEDDED SYSTEMS

▪ Mobile embedded systems are used in portable embedded devices


like cell phones, mobiles, digital cameras, mp3 players and personal
digital assistants, etc.

▪ The basic limitation of these devices is the other resources and


limitation of memory.

7
BASED ON THE PERFORMANCE OF THE MICROCONTROLLER

Small Scale Embedded Systems

▪ These types of embedded systems are designed with a single 8


or 16- bit microcontroller, that may even be activated by a battery.

▪ For developing embedded software for small scale embedded systems,


the main programming tools are an editor, assembler, cross assembler
and integrated development environment (IDE).

8
Medium Scale Embedded Systems

❑ These types of embedded systems design with a single or 16 or 32 bit


microcontroller, RISCs or DSPs.

❑ These types of embedded systems have both hardware and software complexities.

❑ For developing embedded software for medium scale embedded systems, the main
programming tools are C, C++, JAVA, Visual C++, RTOS, debugger, source code
engineering tool, simulator and IDE.

9
Sophisticated Embedded Systems

▪ These types of embedded systems have enormous hardware and


software complexities, that may need ASIPs, IPs, PLAs, scalable or
configurable processors.

▪ They are used for cutting-edge applications that need hardware and software
Co-design and components which have to assemble in the final system.

November 2, 2019 10
What is network’s importance in embedded system?

▪ A BUS is used to connect different network devices and to transfer a


huge range of data, for example, serial bus, I2C bus, CAN bus, etc.

▪ The Ethernet type network works with the TCP/IP protocol.

▪ Examples of embedded networking include CAN, I2C, Component,


sensor, and serial bus networking.
What types of networks are used in the
embedded system?
▪ Telecommunication systems make use of numerous embedded systems
ranging from telephone switches for the network to mobile phones at end user.

▪ Computer networking uses dedicated routers and Network Bridge to route


data.

▪ The Advanced HVAC system uses networked thermostats for more accurate
and efficient control of temperature that may change during a day or season.

▪ The home automation system uses wired and wireless networking to control
lights, climate, security, audio and so on.
Embedded Communication
▪ Point-to-point networks
▪ Each node connected to every node
▪ Simple and reliable
▪ Dedicated links make it easy to meet real-time deadlines
▪ Costly due to many wires required

▪ Shared media networks


▪ Nodes are connected via bus or other topologies
▪ Less wiring and hence cheaper
▪ Easily extendable by adding new nodes to network
▪ Complex network protocol
▪ Being the system of focus from now on
Network resources & qualitative parameters
▪ Network resources
▪ Bandwidth
▪ Buffer space
▪ Protocol efficiency (data bits/bandwidth). Depends on
▪ Message overhead

▪ Media access overhead

▪ Determinacy (ability to calculate worst-case response time)


▪ Robustness
▪ cost
Concepts
▪ Event based communication
▪ E.g. alarm, user inputs, requests for data from other systems

▪ State based communication


▪ E.g. regular sensor readings
▪ Predictability
Event based system
▪ Efficient use of network resource
▪ Needs high reliability (event based data comes once in a while)
▪ May need acknowledgement
▪ Hard to predict delay in case of overloading (e.g. alarm)
State based system
▪ Messages 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 must keep data long enough for other to
see.
E.g. button pressed may need to be repeated.
Open System Interconnection OSI

• The Open Systems Interconnection is model


developed by International Standards Organization.
• Intended for computers
• Designed to solve compatibility problem
• Layers provide standard interface and services
• Embedded systems use some standardization ideas
• Higher layers require lower layers to work
7 Application OSI REFERENCE MODEL

6 Presentation 1. Physical Layer

5 Session a) Convert the logical 1’s and 0’s coming from layer 2 into electrical signals.

b) Transmission of the electrical signals over a communication channel.


4 Transport
Main topics:
3 Network
• Transmission mediums
• Encoding
2 Data Link • Modulation
• RS232 and RS422 standards
1 Physical • Repeaters
• Hubs (multi-port repeater)
7 Application OSI REFERENCE MODEL

6 Presentation 2. Data Link Layer

5 Session a) Error control to compensate for the imperfections of the physical layer.

b) Flow control to keep a fast sender from swamping a slow receiver.


4 Transport
Main topics:
3 Network
• Framing methods
• Error detection and correction methods
2 Data Link • Flow control
• Frame format
1 Physical • IEEE LAN standards
• Bridges
• Switches (multi-port bridges)
7 Application OSI REFERENCE MODEL

6 Presentation 3. Network Layer

5 Session a) Controls the operation of the subnet.

b) Routing packets from source to destination.


4 Transport
c) Logical addressing.
3 Network
Main topics:

2 Data Link • Internetworking


• Routing algorithms
1 Physical • Internet Protocol (IP) addressing
• Routers
7 Application OSI REFERENCE MODEL

6 Presentation 4. Transport Layer

5 Session a) Provides additional Quality of Service.

b) Heart of the OSI model.


4 Transport
Main topics:
3 Network
• Connection-oriented and connectionless services
• Transmission Control Protocol (TCP)
2 Data Link • User Datagram Protocol (UDP)

1 Physical
7 Application OSI REFERENCE MODEL

6 Presentation 5. Session Layer

5 Session a) Allows users on different machines to establish sessions between them.

b) One of the services is managing dialogue control.


4 Transport
c) Token management.
3 Network
d) Synchronization.

2 Data Link

1 Physical
7 Application OSI REFERENCE MODEL

6 Presentation 6. Presentation Layer

5 Session a) Concerned with the syntax and semantics of the information.

b) Preserves the meaning of the information.


4 Transport
c) Data compression.
3 Network
d) Data encryption.

2 Data Link

1 Physical
7 Application OSI REFERENCE MODEL

6 Presentation 7. Application Layer

5 Session a) Provides protocols that are commonly needed.

Main topics:
4 Transport
• File Transfer Protocol (FTP)
3 Network • HyperText Transfer Protocol (HTTP)
• Simple Mail Transfer Protocol (SMTP)
• Simple Network Management Protocol (SNMP)
2 Data Link • Network File System (NFS)
• Telnet
1 Physical
SUMMARY
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 medium
▪ Data link (Layer 2) provides Media Access Control (MAC)
Media Access Control (MAC)
Many protocols are taken from computer networks

1. Connection oriented protocols


2. Polling
3. TDMA
4. Token passing
5. Binary countdown (Bit dominance)
6. CSMA/CD
7. CSMA/CA
Protocol overview
Connection oriented protocols

▪ 2 nodes per each connection only


▪ If nodes are not directly connected, data is relayed
▪ Deterministic delay between directly connected nodes, high delay for indirectly
connected nodes
▪ Suitable to systems with low communication requirements.
▪ Node with pass-through traffic can be fully occupied.
▪ E.g. telephone network service
Polling

▪ Simple and deterministic


▪ Needs a master node
▪ Master periodically polls slave nodes
▪ Consumes bandwidth
▪ E.g. military aircraft communication
▪ Simple slave nodes, complex master
Time Division Multiple Access (TDMA)

▪ Masters broadcasts sync signal to synchronize all clocks


▪ Then each node sends data on its time slot.
▪ Similar but more efficient than polling (synchronize once vs polling all nodes
individually.
▪ more complex nodes due to timing requirements.
▪ Fixed length messages (inflexible)
▪ E.g. satellite communications
.

Token ring

▪ Ring shape network


▪ Token (signal) is passed from node to node
▪ Node can hold token, send message all the way round the ring, and pass token on
▪ Deterministic under heavy load
▪ Some token overhead
▪ Can add priority by having extra field in token
▪ More complexity in detecting token lost
▪ Cable break disrupts network (needs dual ring)
▪ E.g. many Wide Area Networks (WANs)
Token bus

▪ Similar to token ring


▪ Token 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
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 identification
▪ Bus 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)
▪ Heavy load can cause long delay for low priority Controller Area Network (CAN)
messages (no bound)
▪ Applied in industrial and automotive and SAE standard J 1850
Binary countdown cont…
Carrier Sense Multiple Access with Collision Detection
(CSMA/CD)

▪ Nodes wait for idle channel before transmitting.


▪ When simultaneously transmission is detected, each node stops and waits for
random time before resending.
▪ Easy to add or take off new nodes without initialization and configuration
▪ Low overhead at light traffic
▪ Unbound overhead at heavy traffic (messages keeps colliding) hence low
determinacy and efficiency.
▪ Requires detection circuit
Carrier Sense Multiple Access with Collision Avoidance
(CSMA/CA)
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, synchronizes
clocks and start contention time slot.
▪ Unique time slot is assigned to each node
▪ Rotate time slot for fairness
▪ Network return to normal state when all slots are unused.

▪ 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.
Media access comparison
•Polling, TDMA, and connection-based protocols are simple, but may not provide
sufficient flexibility for advanced systems.

•Token-based protocols are predictable but can have high overhead and require
complex software to maintain robustness.

•Binary count-down protocols rely heavily on the bit dominance characteristics of the
physical medium.

•CSMA/CD is a poor choice for hard real-time systems with heavy traffic.

•For our embedded systems, we have found that CSMA/CA, and in particular
Reservation CSMA is a good choice.
Media access comparison
Advanced communication principles
1. 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
2. Parallel communication
▪ Physical layer capable of transporting multiple bits of data

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

4. Wireless communication
▪ No physical
75 connection needed for transport at physical layer
2. Parallel communication
▪ Multiple data, control, and possibly power wires
▪ One bit per wire
▪ High data throughput with short distances
▪ Typically used when connecting devices on same IC or same circuit board
▪ Bus 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

76
Parallel Protocols
▪ PCI (Peripheral Component Interconnect)
▪ Originated at Intel 1990 and then administered by PCISIG
▪ First used in 1994
▪ For interconnecting chips, expansion boards, & processor memory subsystem.
▪ Replaced ISA/EISA bus
▪ Transfer rate: 127.2 – 508.6 Mbit/s
▪ 32-bit addressing later extended to 64-bit
▪ Sync bus architecture
▪ ARM
▪ Designed by ARM Corporation
▪ Designed to interface with ARM line of processors.
▪ 32 data/address
▪ Sync data architecture
▪ Transfer rate not specified (function of the clock speed) 77
3. Serial communication
▪ Single data wire, possibly also control and power wires
▪ Words transmitted one bit at a time
▪ Higher data throughput with long distances
▪ Less average capacitance, so more bits per unit of time
▪ Cheaper, less bulky
▪ More complex interfacing logic and communication protocol
▪ Sender needs to decompose word into bits
▪ Receiver needs to recompose bits into word
▪ Control signals often sent on same wire as data increasing protocol complexity

78
Serial Protocols
⚫ I2C (Inter-IC)
⚫ Developed by Philips Semiconductors
⚫ 2 wire bus protocol
⚫ Connect peripheral ICs in electronic systems
⚫ Transfer rate: up to 100 kbit/s, 7-bit address
⚫ Fast mode: 3.4 Mbit/s, 10-bit address
⚫ Flash, RAM, EPROM, Microcontrollers …
⚫ CAN (Controller Area Network)
⚫ For real-time application
⚫ Developed by Robert Bosch GmbH to connect various components of car
⚫ Over twisted pair of wires
⚫ High integrated serial data communication
⚫ Data rate up to 1 Mbit/s
⚫ 11-bit addressing
⚫ Documented in ISO 11898 & ISO 11519-2 79

⚫ Common applications: Automobiles, elevator controllers, copiers, telescopes, …


Serial Protocols
⚫ FireWire (I-Link or Lynx)
⚫ Developed by Apple Computer Inc.
⚫ Specification is given by IEEE 1394
⚫ Mass information transfer
⚫ Transfer rate: 12.5 – 400 Mbit/s
⚫ 64-bit addressing (64b net id, 6b node id, 48b mem addr)
⚫ Real-time connection and disconnect and assignment (Plug and Play)
⚫ Designed for interfacing independent electronic devices.
⚫ USB (Universal Serial Bus)
⚫ Has 2 data rates: 12 Mb/s, 1.5 Mb/s
⚫ For PC users to connect monitors, printers, scanners, …
⚫ Used tiered star topology (USB hubs)

Real-time Embedded Systems/Interfacing 80


4. Wireless communication
▪ Infrared (IR)
▪ Electronic wave frequencies just below visible light spectrum
▪ Diode emits infrared light to generate signal
▪ Infrared transistor detects signal, conducts when exposed to infrared light
▪ Cheap to build
▪ Need line of sight, limited range
▪ Radio frequency (RF)
▪ Electromagnetic wave frequencies in radio spectrum
▪ Analog circuitry and antenna needed on both sides of transmission
▪ Line of sight not needed, transmitter power determines range

81
Wireless Protocols
⚫ IrDA (Infrared Data Association)
⚫ IrDA is an international organization
⚫ Designed to support transmission between two devices over short-range point-to-point infrared.
⚫ Rate: 9.6 Kb/s – 4 Mb/s
⚫ Deployed in notebooks, printers, PDAs, cell phones,…
⚫ MS Windows CE 1.0 the first Windows OS support it
⚫ Available on several popular embedded OSs
⚫ Bluetooth
⚫ Use radio frequency
⚫ Within 10 meters
⚫ Doesn’t require a line-of-sight connection
⚫ IEEE 802.11
⚫ IEEE proposed standard for WLAN
⚫ Ad-hoc vs. infrastructure
⚫ PHY and MAC layers
⚫ Data rate: 1Mbps, 2Mbps
⚫ Calls: 2.4 – 2.4835 GHz frequency band (unlicensed band).
⚫ Use CSMA/CA 82
⚫ Signals for transmission: RTS, CTS, and ACK.
Automotive standards
❑ 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)


Manufacturing Automation Standards
❑ 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)


❑ Centralized arbitration
Military Standards
❑ 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.
References
1. Upender B, Koopman P, Embedded communication protocol
options, Proc. to the 5th annual embbeded system conference, 1993
2. Rollins L, Embedded communication
3. Kopetz H, Real-time system design principles for distributed
embedded applications, Kluver, 1997
4. Liu J, Real-time systems, Prentice-Hall, 2000
5. 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

S-ar putea să vă placă și