Ch.12 Communication Systems Valvano’s text. 12.1 Introduction SCI can be used to create a network. Figure 12.1 gives a general visualization. –At lowest.

Slides:



Advertisements
Similar presentations
Computer Architecture
Advertisements

System Integration and Performance
Categories of I/O Devices
Arctic IEC-104 Gateway Jari Lahti, CTO.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
Serial I/O - Programmable Communication Interface
DATA COLLECTION USING ZIGBEE NETWORK Timothy Melton Moscow, ID.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
Computer Systems/Operating Systems - Class 8
Internetworking Fundamentals (Lecture #4) Andres Rengifo Copyright 2008.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
CMPT 300: Operating Systems Review THIS REIVEW SHOULD NOT BE USED AS PREDICTORS OF THE ACTUAL QUESTIONS APPEARING ON THE FINAL EXAM.
Guitar Effects Processor Critical Design Review October, 07, 2003 Groups Members: Adam Bernstein Hosam Ghaith Jasenko Alagic Matthew Iyer Yousef Alyousef.
OS Spring’03 Introduction Operating Systems Spring 2003.
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Input/Output and Communication
 The Open Systems Interconnection model (OSI model) is a product of the Open Systems Interconnection effort at the International Organization for Standardization.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Gursharan Singh Tatla Transport Layer 16-May
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 13.
Layer 2 Switch  Layer 2 Switching is hardware based.  Uses the host's Media Access Control (MAC) address.  Uses Application Specific Integrated Circuits.
Lecture 12 Today’s topics –CPU basics Registers ALU Control Unit –The bus –Clocks –Input/output subsystem 1.
Computer Architecture Lecture 08 Fasih ur Rehman.
USART Communication using the RS standard ETEC6416.
Chapter 4.  Understand network connectivity.  Peer-to-Peer network & Client-Server network  Understand network topology  Star, Bus & Ring topology.
1 Input/Output. 2 Principles of I/O Hardware Some typical device, network, and data base rates.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
CSC 311 IEEE STANDARD ETHERNET Common Bus topology Uses CSMA/CD Named after “ether”, the imaginary substance many once believed occupied all of space.
AS Computing F451 F451 Data Transmission. What data is transmitted? Phone SMS Radio TV Internet.
Ch. 9 Interrupt Programming and Real-Time Sysstems From Valvano’s Introduction to Embedded Systems.
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
CSC 322 Operating Systems Concepts Lecture - 25: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
MICROPROCESSOR INPUT/OUTPUT
Computer Security and Penetration Testing
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
ECE 353 Introduction to Microprocessor Systems Michael Schulte Week 13.
Computer Architecture Lecture10: Input/output devices Piotr Bilski.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
Other Chapters From the text by Valvano: Introduction to Embedded Systems: Interfacing to the Freescale 9S12.
Input/Output 2 What is I/O? How we get the CPU to communicate with devices From the computer’s point of view, it’s just 1’s and 0’s Gets interpreted.
Autonomous Helicopter James LydenEE 496Harris Okazaki.
Interrupts, Buses Chapter 6.2.5, Introduction to Interrupts Interrupts are a mechanism by which other modules (e.g. I/O) may interrupt normal.
I/O Computer Organization II 1 Interconnecting Components Need interconnections between – CPU, memory, I/O controllers Bus: shared communication channel.
L/O/G/O Input Output Chapter 4 CS.216 Computer Architecture and Organization.
©2008 R. Gupta, UCSD COSMOS Summer 2008 Peripheral Interfaces Rajesh K. Gupta Computer Science and Engineering University of California, San Diego.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Embedded Computer - Definition When a microcomputer is part of a larger product, it is said to be an embedded computer. The embedded computer retrieves.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Data Communication Networks Lec 13 and 14. Network Core- Packet Switching.
Lab 9 Multiprocessor, Buses, SPI, I2C. Multiprocessors Why multiprocessors? The structure of multiprocessors. Elements of multiprocessors: – Processing.
Serial Communications
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
Serial mode of data transfer
Memory Management.
Instructor Materials Chapter 5: Ethernet
Chapter 11: Inter-Integrated Circuit (I2C) Interface
E3165 DIGITAL ELECTRONIC SYSTEM
Asynchronous Serial Communications
Operating Systems Chapter 5: Input/Output Management
CS703 - Advanced Operating Systems
Data Communication Networks
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
COMP755 Advanced Operating Systems
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Ch.12 Communication Systems Valvano’s text

12.1 Introduction SCI can be used to create a network. Figure 12.1 gives a general visualization. –At lowest level frames are transferred between I/O ports, along the physical link. –At the next level the operating system of one computer sends a message or “packet” to the OS of another computer. –The message protocol will specify types and formats of the messages.

12. 1 (cont.) Messages typically have –Addresses –Synchronization or handshake field –Data field –Error detection and correction field

12.1 (cont.) Highest level—communications between users, or high level software tasks.

12.2 Reentrant Programming and Critical Sections If two threads access the same global memory, and one is a write, then there is a causal dependency between the threads. –Shared global variables are important because they are required to pass data between threads. –Hard to find bugs.

12.2 (cont.) A program segment is reentrant if it can be concurrently executed by two or more threads. –Implementation of reentrant program segments avoids storing in global memory. –Also, variables are placed in registers or on the stack.

12.2 (cont.) A nonreentrant subroutine will have a section of code called a vulnerable window or critical section. Errors –(1)One thread calls the non-reentrant subroutine –(2) It is executing in the critical section when interrupted by a second thread. –(3) The second thread calls the same subroutine.

12.2 (cont.) Possibilities: –The second thread is allowed to complete the execution of the subroutine, then the first thread finishes the subroutine. –The second thread executes part of the subroutine, is interrupted, and then re-entered by a third thread; the third thread finishes, the second thread finishes, then control is passed to the first thread and it finishes.

12.2 (cont.) Program 12.1 illustrates a non-reentrant function, since num is a global variable used by the functions (in assembly and C). –(In C) short num; – short Ave (short first, short second){ – num = first; – return (num+second)/2; –This is non-reentrant because of the access to a global—num.

12.3 Interthread Communication and Synchronization A simple inter-thread scheme is a mailbox. Figure 12.2 illustrates an input device interfaced using interrupt synchronization.

Producer Consumer Problem First In First Out (FIFO) circular Queue and double buffer. Data Structures that can be used to link a source process (producer) with a sink process (consumer). Fig (page 440) Table 12.1 (examples of producers/consumers)

(cont.) A first in first out circular queue (FIFO) is useful for the implementation of a buffered I/O interface. After initialization, the queue “puts” and “gets” data. This allows the foreground thread to run while a second thread runs in the background.

A data flow graph is shown in Figure –There is buffered input and buffered output illustrated. –Valvano’s text—FIFO’s are implemented using statically allocated global structures. –An advantage of the FIFO is that the producer and consumer threads can be decoupled – this will improve system performance. –Without the FIFO, data will have to be processed one at a time.

Timing Let t p be the time (in sec.) between calls to Put, and r p be the arrival rate (in bytes/sec) into the system. Let t g be the time (in sec.) between calls to Get and r g be the service rate (in bytes/sec) out ot the system.

Timing (cont.) Then r g = 1/t g and r p = 1/t p. If min t p ≥ max t g, then a FIFO is not needed and a mailbox can be used. If the average input rate is larger than the average ouput rate then a FIFO will eventually overflow, no matter how large the FIFO is. But if r p is temporarily high or r g is temporarily low, (and the FIFO becomes full) then this problem can be solved by increasing the FIFO size.

Checkpoint 12.5 If the FIFO becomes full, can the situation be solved by increasing the size? Answer: –No, if the average producer rate exceeds the average consumer rate. –Yes, if the temporary producer rate exceeds the temporary consumer rate.

Figure 12.6 This shows FIFO queues that are used to pass data between threads. –OutChar is called by the main program when it wishes to output data. –InChar is called by the main program when it wishes to input data.

FIFO Queue Implementation Figure 12.7 FIFO implementation with infinite memory. Program 12.3 illustrates some code fragments. Figures 12.8,12.9 showing Put and Get operations with a pointer wrap.

12.3.4Double Buffer Figure shows the storing of data in one buffer while data is read from a second buffer and processed. A double buffer is two buffers of fixed size. –Example: Disk (see figure.) –Disk has fixed size blocks—buffers are the size as the blocks.

12.4 Serial Port Interface Using Interrupt Synchronization Example: connect to a PC serial port. –Baud rate must match. –FIFO’s are used. –Initially just the receiver is armed. –Transmitter will be armed when data is available within the SCI_OutChar routine. –Interrupt occurs when new data arrives in the receiver data register, and an interrupt occurs when the transmit data register is empty.

Program 12.5 Page 448, implementations of an interrupting SCI interface.

12.5 Distributed Systems Three simple communication systems using the SCI port. –If distances are short, half-duplex can be implemented with simple open collector or open-drain TTL-level logic.

System 1 Master-slave configuration –Master transmit output is connected to all slave receive inputs (Fig , page 449) –Master broadcasts commands. –Slaves can respond, one at a time. –When Master transmits, it is to all slaves. –If slaves only transmit after being triggered by the master, there will be no collisions.

System 2: Ring Network Transmitter and Receiver lines are connected in a circle. Figure 12.13—three microcomputers connected using the SCI in each. Simple to build but slow performance (response time and bandwidth). It is also difficult to add/subtract nodes.

System 3: Multi-drop Figure 12.14, page 451 –Software activates the SP483 Driver and outputs the frame. –Half-duplex—the frame can be echoed back. –Errors can also be discovered using parity checks or checksums.

Checkpoint How can the transmitter detect a collision had corrupted its output? ANSWER: The frame sent by a transmitter is echoed to its own receiver. If the data does not match, or if thre are any framing or noise errors then a collision has occurred.

Checkpoint 12.12: How can the receiver detect a collision had corrupted its input? ANSWER: Parity could be used to detect collisions. Also the message could have a checksum added. Framing or noise errors can also indicate a collision.

12.6 Design an Implementation of a Controller Area Network (CAN) CAN –A serial data communications bus –Used for real-time applications. –Operate at speeds up to 1 Mbps. –Error detection capabilities. –Developed by Robert Bosch for use in autos. –Now used in industrial automation and control applications.

12.6 CAN (cont.) Has been standardized—ISO Figure 12.15—CAN base system using 9S12’s. Can have up to 112 nodes. Four Components –(1) Bus—2-wires;CANH and CANL; termination is a 120ohm resistor. –(2) Transceiver—can transmit and receive on the same channel. –(3) CAN Controller –(4) Software; used to transmit and process data.

12.7 Integrated Circuit (I 2 C) Interface Historically, users want microcontrollers to require less power and space for embedded systems application. Two Ways –Integrate functionality into the microcontroller. –Reduce the number of I/O pins. I 2 C—proposed by Phillips in the 1980’s; originally use to interface devices using 2-wires v1 became an industry standard.

12.7 (cont.) Figure 12.19—shows network made of masters and slaves. –Both lines are bidirectional. –SCL—serial clock line. –SDA—serial data line.

12.8 Wireless Communications Design concerns –Bandwidth –Distance –Topology –Security Figure –Short Range Device –SPI interface is illustrated