Chap 3Lesson02EmsysNew

41
2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 1 DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK Lesson Lesson - - 2: 2: Ports or Devices Ports or Devices Communication and communication Communication and communication - - protocols protocols

Transcript of Chap 3Lesson02EmsysNew

Page 1: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 1

DEVICES AND COMMUNICATIONBUSES FOR DEVICES NETWORK

LessonLesson--2: 2: Ports or DevicesPorts or DevicesCommunication and communicationCommunication and communication--

protocolsprotocols

Page 2: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 2

• Full Duplex – Both devices or device and computer system simultaneously communicate each other

• Half Duplex – Only one device can communicate with another at an instance

Two Modes of communication between the Two Modes of communication between the devices and computer systemdevices and computer system

Page 3: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 3

• Synchronous• Iso-synchronous• Asynchronous

Three ways of communication between Three ways of communication between the ports or devicesthe ports or devices

Page 4: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 4

1. Synchronous and Iso-synchronous Communication in Serial Ports or

Devices

Page 5: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 5

Synchronous CommunicationSynchronous Communication

� When a byte (character) or a frame (a collection of bytes) in of the data is received or transmitted at the constant time intervals with uniform phase differences, the communication is called as synchronous. Bits of a full frame are sent in a prefixed maximum time interval.

Page 6: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 6

IsoIso--synchronoussynchronous

� Synchronous communication special case−when bits of a full frame are sent in the maximum time interval, which can be variable.

Page 7: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 7

• Clock information is transmitted explicitly or implicitly in synchronous communication. The receiver clock continuously maintains constant phase difference with the transmitter clock. Bits of a data frame maintain uniform phase difference and are sent within a fixed maximum time interval

Synchronous CommunicationSynchronous Communication

Page 8: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 8

Example of synchronous serial Example of synchronous serial communicationcommunication

� Frames sent over a LAN. Frames of data communicate with the constant time intervals between each frame remaining constant.

� Another example is the inter-processor communication in a multiprocessor system

Page 9: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 9

OptionalOptional Synchronous Synchronous Code bitsCode bits� Optional Sync Code bits or bi-sync code bits or

frame start and end signaling bits─ During communication few bits (each separated by interval ∆T) sent as Sync code to enable the frame synchronization or frame start signaling.

� Code bits precede the data bits. � May be inversion of code bits after each frame in

certain protocols. � Flag bits at start and end are also used in certain

protocols.

Page 10: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 10

Always present Always present Synchronous device port Synchronous device port data bitsdata bits

� Reciprocal of T is the bit per second (bps).

� Data bits─ m frame bits or 8 bits transmit such that each bit is at the line for time ∆T or, each frame is at the line for time (m. T)

� m may be 8 or a large number. It depends on the protocol

Page 11: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 11

Synchronous device clock bitsSynchronous device clock bits� Clock bits ─ Either on a separate clock

line or on data line such that the clock information is also embedded with the data bits by an appropriate encoding or modulation

� Generally not optional

Page 12: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 12

Ten ways of Transmitting Synchronous Serial bits

Page 13: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 13

First characteristics of synchronous First characteristics of synchronous communicationcommunication

1. Bytes (or frames) maintain a constant phase difference, which means they are synchronous, i.e. in synchronization. No permission of sending either the bytes or the frames at the random time intervals, this mode therefore does not provide for handshaking during the communication interval ─ This facilitates fast data communication at pre-fixed bps.

Page 14: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 14

Second characteristics of synchronous Second characteristics of synchronous communicationcommunication

2. A clock ticking at a certain rate has always to be there for transmitting serially the bits of all the bytes (or frames) serially. Mostly, the clock is not always implicit to the synchronous data receiver. The transmitter generally transmits the clock rate information

Page 15: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 15

2. Asynchronous Communication from Serial 2. Asynchronous Communication from Serial Ports or Devices Ports or Devices

Page 16: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 16

• Clocks of the receiver and transmitter independent, unsynchronized, but of same frequency and variable phase differences between bytes or bits of two data frames, which may not be sent within any prefixed time interval.

Asynchronous CommunicationAsynchronous Communication

Page 17: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 17

Example of asynchronous communication Example of asynchronous communication

• UART Serial, Telephone or modem communication.

• RS232C communication between the UART devices

• Each successive byte can have variable time-gap but have a minimum in-between interval and no maximum limit for full frame of many bytes

Page 18: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 18

Two characteristics of asynchronous Two characteristics of asynchronous communicationcommunication

1. Bytes (or frames) need not maintain a constant phase difference and are asynchronous, i.e., not in synchronization. There is permission to send either bytes or frames at variable time intervals─ This facilitates in-between handshaking between the serial transmitter port and serial receiver port

Page 19: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 19

Two characteristics of asynchronous Two characteristics of asynchronous communicationcommunication

2. Though the clock must ticking at a certain rate always has to be there to transmit the bits of a single byte (or frame) serially, it is always implicit to the asynchronous data receiver and is independent of the transmitter

Page 20: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 20

Clock FeaturesClock Features

� The transmitter does not transmit (neither separately nor by encoding using modulation) along with the serial stream of bits any clock rate information in the asynchronous communication and receiver clock thus is not able to maintain identical frequency and constant phase difference with transmitter clock

Page 21: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 21

Example: Example: IBM personal computer has two COM IBM personal computer has two COM ports (communication ports) ports (communication ports)

� COM1 and COM2 at IO addresses 0x2F8-0xFF and 0xx38-0x3FF

� Handshaking signals─ RI, DCD, DSR, DTR, RTS, CTS, DTR

� Data Bits─ RxD and TxD

Page 22: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 22

Example: COM port and Modem Handshaking Example: COM port and Modem Handshaking signals signals

� When a modem connects, modem sends data carrier detect DCD signal at an instance t0.

� Communicates data set ready (DSR) signal at an instance t1 when it receives the bytes on the line.

� Receiving computer (terminal) responds at an instance t2 by data terminal ready (DTR) signal.

Page 23: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 23

Example: COM port and Modem Handshaking Example: COM port and Modem Handshaking signals signals

� After DTR, request to send (RTS) signal is sent at an instance t3

� Receiving end responds by clear to send (CTS) signal at an instance t4. After the response CTS, the data bits are transmitted by modem from an instance t5 to the receiver terminal.

� Between two sets of bytes sent in asynchronous mode, the handshaking signals RTS and CTS can again be exchanged. This explains why the bytes do not remain synchronized during asynchronous transmission.

Page 24: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 24

COM port and Modem Signals COM port and Modem Signals

Page 25: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 25

3. Communication Protocols3. Communication Protocols

Page 26: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 26

� A protocol is a standard adopted, which tells the way in which the bits of a frame must be sent from a device (or controller or port or processor) to another device or system

[Even in personal communication we follow a protocol – we say Hello! then talk and then say good bye!]

1. Protocol

Page 27: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 27

A protocol defines how are the frame A protocol defines how are the frame bitsbits:

1) sent− synchronously or Iso-synchronously or asynchronously and at what rate(s)?

2) preceded by the header bits?

Page 28: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 28

3) How the receiving device address communicated so that only destined device activates and receives the bits? [Needed when several devices addressed though a common line (bus)]

Page 29: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 29

4) How can the transmitting device address defined so that receiving device comes to know the source when receiving data from several sources?

5) How the frame-length defined so that receiving device know the frame-size in advance?

Page 30: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 30

6) Frame-content specifications −Are the sent frame bits specify the control or device configuring or commend or data?

7) Are there succeeding to frame the trailing bits so that receiving device can check the errors, if any in reception before it detects end of the frame ?

Page 31: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 31

A protocol may also define:

8) Frame bits minimum and maximum length permitted per frame

9) Line supply and impedances and line-Connectors specifications

Page 32: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 32

IO port bits sent after first formatted according to a specified protocol, which is to be followed when communicating with another device through an IO port or channel

Specified protocol at an embedded system port or communication device

Page 33: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 33

ProtocolsProtocols� HDLC, Frame Relay, for synchronous

communication � For asynchronous transmission from a device

port− RS232C, UART, X.25, ATM, DSL and ADSL

� For networking the physical devices in telecommunication and computer networks −Ethernet and token ring protocols used in LAN networks

Page 34: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 34

Protocols in embedded network devicesProtocols in embedded network devices

� For Bridges and routers� Internet appliances application protocols

and Web protocols ─HTTP (hyper text transfer protocol), HTTPS (hyper text transfer protocol Secure Socket Layer), SMTP (Simple Mail Transfer Protocol), POP3 (Post office Protocol version 3), ESMTP (Extended SMTP),

Page 35: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 35

File transfer, Boot Protocols in embedded devices File transfer, Boot Protocols in embedded devices networknetwork

� TELNET (Tele network), � FTP (file transfer protocol), � DNS (domain network server), � IMAP 4 (Internet Message Exchange

Application Protocol) and � Bootp (Bootstrap protocol).

Page 36: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 36

Wireless Protocols in embedded devices networkWireless Protocols in embedded devices network

� Embedded wireless appliances uses wireless protocols─WLAN 802.11, 802.16, Bluetooth, ZigBee, WiFi, WiMax,

Page 37: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 37

SummarySummary

Page 38: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 38

We learnt� Three communication types- synchronous,

iso-synchronous and asynchronous� Synchronous communication provides for

sync code bits, data bits and clock bits at constant time intervals,

� Receiver (slave) synchronizes clock frequency and phase with the transmitter (master)

� Synchronous communication fast

Page 39: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 39

We learnt� Isosynchronous communication a special

case of synchronous communication � Asynchronous communication provides for

handshaking bits and variable time intervals for bytes/frame communication

� Examples of IBM PC COM port and modem handshaking bits

Page 40: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 40

We learnt� Concept of Protocol and the format of bits

in a protocol (ii) Header bits format – Header bits precedes the

data bits(iii) Trailing bits – succeeds the data� Various Protocols for the embedded

device network

Page 41: Chap 3Lesson02EmsysNew

2008 Chapter-3 L02: "Embedded Systems - " , Raj Kamal, Publs.: McGraw-Hill Education 41

End of Lesson 2 of Chapter 3End of Lesson 2 of Chapter 3