COMP3221 lec29-io-examples-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 29: I/O Interfacing Examples - I

Slides:



Advertisements
Similar presentations
Nios Multi Processor Ethernet Embedded Platform Final Presentation
Advertisements

IO Interfaces and Bus Standards. Interface circuits Consists of the cktry required to connect an i/o device to a computer. On one side we have data bus.
Computer Buses Ref: Burd, Chp – 220 Englander, Chp 7 p
IT253: Computer Organization
Bus structures Unit objectives:
Course ILT Bus structures Unit objectives Describe the primary types of buses Define interrupt, IRQ, I/O address, DMA, and base memory address Describe.
HARDWARE Rashedul Hasan..
Computer Organization, Bus Structure
CS61C L16 Disks © UC Regents 1 CS161 Lecture 25 - Disks Laxmi Bhuyan
Princess Sumaya Univ. Computer Engineering Dept. Chapter 6:
1 Operating Systems Input/Output Management. 2 What is the I/O System A collection of devices that different sub- systems of a computer use to communicate.
Lecture 21Comp. Arch. Fall 2006 Chapter 8: I/O Systems Adapted from Mary Jane Irwin at Penn State University for Computer Organization and Design, Patterson.
COMP3221 lec26-io.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 26: I/O Interfacing September,
INPUT-OUTPUT ORGANIZATION
CS1104 – Computer Organization
CS61C L13 I/O © UC Regents 1 CS 161 Chapter 8 - I/O Lecture 17.
COMP3221 lec23-decode.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 23: Instruction Representation; Assembly and Decoding.
EXTERNAL COMMUNICATIONS DESIGNING AN EXTERNAL 3 BYTE INTERFACE Mark Neil - Microprocessor Course 1 External Memory & I/O.
82C55 82C55 Programmable Peripheral Interface Interfacing Part III.
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
 The central processing unit (CPU) interprets and executes instructions.  The “brains” of the computer.  The speed of the processor is how fast it.
Introduction to Information Technology: Your Digital World © 2013 The McGraw-Hill Companies, Inc. All rights reserved.Using Information Technology, 10e©
COMP3221 lec31-mem-bus-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 31: Memory and Bus Organisation - I
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
System Unit By Sam Gibbs. System Unit The main part of a personal computer Includes a chassis, microprocessor, main memory, bus, and ports Does not include.
Input-Output Problems L1 Prof. Sin-Min Lee Department of Mathematics and Computer Science.
Interface circuits I/O interface consists of the circuitry required to connect an I/O device to a computer bus. Side of the interface which connects to.
Chapter 4 Section 3.
INPUT-OUTPUT ORGANIZATION
Module I Overview of Computer Architecture and Organization.
INPUT/OUTPUT ARCHITECTURE By Truc Truong. Input Devices Keyboard Keyboard Mouse Mouse Scanner Scanner CD-Rom CD-Rom Game Controller Game Controller.
SECTION 4B CPUs Used in Personal Computers. This lesson introduces: A Look Inside the Processor Microcomputer Processors Parallel Processing Extending.
Chapter 2 How Computers Work.
Chapter 8 Input/Output. Busses l Group of electrical conductors suitable for carrying computer signals from one location to another l Each conductor in.
Bus structures Unit objectives Describe the primary types of buses, and define interrupt, IRQ, I/O address, DMA, and base memory address Describe the features.
Introduction to Computing: Lecture 4
LOGO BUS SYSTEM Members: Bui Thi Diep Nguyen Thi Ngoc Mai Vu Thi Thuy Class: 1c06.
Organization of a computer: The motherboard and its components.
Exercise 2 The Motherboard
Dr. Rabie A. Ramadan Al-Azhar University Lecture 6
Computer Architecture Lecture 8 by Engineer A. Lecturer Aymen Hasan AlAwady 30/12/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
The Computer Systems. Computer System CPU Is the brain of the PC. All program instructions are run through the CPU Control Unit This decodes and executes.
Computer Architecture Lecture 9 by Engineer A. Lecturer Aymen Hasan AlAwady 10/2/2014 University of Kufa - Information Technology Research and Development.
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.
Output Devices. Printers Factors affecting choice Volume of output High volume require fast, heavy-duty printer Quality of print required Location of.
The Mechanics Of Computers The Operating System (OS) & Hardware.
COMPUTER ARCHITECTURE. Recommended Text 1Computer Organization and Architecture by William Stallings 2Structured Computer Organisation Andrew S. Tanenbaum.
August 1, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 9: I/O Devices and Communication Buses * Jeremy R. Johnson Wednesday,
General Concepts of Computer Organization Overview of Microcomputer.
CS-350 TERM PROJECT COMPUTER BUSES By : AJIT UMRANI.
Computer System Internal components - The processor - Main memory - I / O controllers - Buses External components (peripherals). These include: - keyboard.
Introduction to Microprocessors Manijeh Keshtgary Fall 2006 Shiraz University of Technology.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
CS2100 Computer Organisation Input/Output – Own reading only (AY2015/6) Semester 1 Adapted from David Patternson’s lecture slides:
Five Components of Computers Input Output Memory Control Datapath Processor.
THE MICROPROCESSOR A microprocessor is a single chip of silicon that performs all of the essential functions of a computer central processor unit (CPU)
بسم الله الرحمن الرحيم MEMORY AND I/O.
Overview of microcomputer structure and operation
Department of Computer Science and Engineering
Components of Computer
Operating Systems (CS 340 D)
Some of the slides are adopted from Prof. David Patterson (UCB)
May 2006 Saeid Nooshabadi ELEC2041 Microprocessors and Interfacing Lectures 29: I/O Interfacing Examples
Microprocessor & Assembly Language
Komponen Dasar Sistem Komputer
May 2006 Saeid Nooshabadi ELEC2041 Microprocessors and Interfacing Lectures 30: Memory and Bus Organisation - I
Five Key Computer Components
Overview of Computer Architecture and Organization
Lectures 9-1: I/O Interfacing
Modified from notes by Saeid Nooshabadi
Presentation transcript:

COMP3221 lec29-io-examples-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 29: I/O Interfacing Examples - I October, 2003 Saeid Nooshabadi

COMP3221 lec29-io-examples-I.2 Saeid Nooshabadi Overview °Parallel Interfacing °Serial Interfacing UART RS232

COMP3221 lec29-io-examples-I.3 Saeid Nooshabadi Anatomy: 5 components of any Computer Processor (active) Computer Control (“brain”) Datapath (“brawn”) Memory (passive) (where programs, data live when running) Devices Input Output Keyboard, Mouse Display, Printer Disk (where programs, data live when not running)

COMP3221 lec29-io-examples-I.4 Saeid Nooshabadi Review: Buses in a PC: Connect a few devices CPU Memory bus Memory SCSI: External I/O bus (1 to 15 disks) SCSI Interface Ethernet Interface Ethernet Local Area Network °Data rates Memory: 133 MHz, 8 bytes  1064 MB/s (peak) PCI: 33 MHz, 8 bytes wide  264 MB/s (peak) SCSI: “Ultra3” (80 MHz), “Wide” (2 bytes)  160 MB/s (peak) Ethernet: 12.5 MB/s (peak) PCI Interface PCI: Internal (Backplane) I/O bus

COMP3221 lec29-io-examples-I.5 Saeid Nooshabadi Review: I/O Device Examples and Speeds °I/O Speed: bytes transferred per second (from mouse to display: million-to-1) °DeviceBehaviorPartner Data Rate (Kbytes/sec) KeyboardInputHuman0.01 MouseInputHuman0.02 Line PrinterOutputHuman1.00 Floppy diskStorageMachine50.00 Laser PrinterOutputHuman Magnetic DiskStorageMachine10, Network-LANI or OMachine 10, Graphics DisplayOutputHuman30,000.00

COMP3221 lec29-io-examples-I.6 Saeid Nooshabadi Review: DSLMU I/O Addressing OffsetModePort NameFunction 0x00R/WPort A Bidirectional data port to LEDs, LCD, etc. 0x04R/WPort B Control port (some bits are read only) 0x08R/WTimer8-bit free-running 1 kHz timer 0x0CR/W Timer Compare Allows timer interrupts to be generated 0x10ROSerial RxDRead a byte from the serial port 0x10WOSerial TxDWrite a byte to the serial port 0x14WOSerial StatusSerial port status port 0x18R/WIRQ Status Bitmap of currently-active interrupts 0x1CR/WIRQ Enable Controls which interrupts are enabled 0x20WODebug Stop Stops program execution when written to

COMP3221 lec29-io-examples-I.7 Saeid Nooshabadi Parallel Interfacing °In Parallel multiple bytes are transferred between the processor and external devices. Mem  Processor 1, 2 or 4 bytes LCD  Processor 1 byte The advantage:speed all data bits are transferred simultaneously via the system bus (or an extension of this bus). Processor I/O Device D7–D0 Strobe

COMP3221 lec29-io-examples-I.8 Saeid Nooshabadi Parallel Interfacing Problems ° More cost: one wire for each bit + 1 bit for clock (strobe). ° May suffer from skew problem due to unequal time delay for each signal. Used for high data rates over short distances <few cm

COMP3221 lec29-io-examples-I.9 Saeid Nooshabadi Serial Interfacing ° In serial I/O, the data bits are sent one at a time across a single line. The advantage of serial I/O is lower cost (in terms of the number of wires connecting the microcomputer to peripheral device) The disadvantage is slower speed. Processor I/O Device D Strobe

COMP3221 lec29-io-examples-I.10 Saeid Nooshabadi Parallel  Serial Interfacing ° Since communication within a microprocessor takes place over the system bus in parallel form, there is obviously a need for parallel-to serial (and serial-to parallel) conversion when interfacing to serial devices. N P–S Con S–P Con N

COMP3221 lec29-io-examples-I.11 Saeid Nooshabadi Asynchronous Serial Communication °Used in character oriented data transmission between a microprocessor and an external device Transmitter and Receiver each has its own clock running at the same frequency How to synchronize two clocks so to sample in the middle of the data? Data RX Clock TX Clock

COMP3221 lec29-io-examples-I.12 Saeid Nooshabadi Making Asyn. Transmission Work °Receiver Synchronisation: The transmission of first bit should starts with a transition on the data line (1  0) send an extra ‘start’ bit ( = 0) before sending the 8-bit data, data line is always set back to 1 at the end. 1  0 transition always occurs at the start of each transmission. the receive clock now samples 9 bits (start + 8 data bits), the gap (idle time) between successive groups of 9 bits can change Character wide synchronisation (Asynchronous)

COMP3221 lec29-io-examples-I.13 Saeid Nooshabadi Receiver Clock Synchronisation Issues The receiver clock can be made equal to the baud rate clock must be very accurate in order to sample the incoming bit stream in the centre of its cycle. The sample point needs to be very close to the centre of the bit cell for reliable data recovery. The actual variation from the centre on the bit cell is referred to as ratchet error.

COMP3221 lec29-io-examples-I.14 Saeid Nooshabadi Improving Receiver Clock Synchronisation ° If the clock is made 16 times the baud rate, then the ratchet error can be relaxed from  1 % to  5 % ° Rachet relaxes to  25 % for 64 times the baud rate).

COMP3221 lec29-io-examples-I.15 Saeid Nooshabadi Parallel  Serial Conversion ° Asynchronous data transmission uses a special device called Universal Asynchronous Receiver Transmitter ( UART). UART is used to simultaneously transmit and receive serial data performs the appropriate parallel/serial conversions and inserting or checking the extra bits used to keep the serial data synchronised. UART typically configured as 2-4 I/O addresses: input/output status port(s), and output/input data port(s). Bytes sent as 8-bit parallel data to the output data address by the computer are converted into a standard-format serial bit stream for transmission by a transmitter inside the UART Similarly, an incoming serial bit stream is detected by a receiver inside the UART and converted into parallel data that can be read by the computer from the UART's input data address.

COMP3221 lec29-io-examples-I.16 Saeid Nooshabadi Full Duplex VS Half Duplex Data Transmission ° Simultaneous conversion of an incoming and an outgoing serial data stream is called full duplex It requires two data carriers (TxD, and RxD) Implemented with three wires: one for the outgoing stream (TxD), one for the incoming stream (RxD), and the third for a common ground line. The UART does provide for standard full duplex handshaking conventions. ° Half duplex allows two-way communications, hence the name duplex, but only one direction is active at a time.

COMP3221 lec29-io-examples-I.17 Saeid Nooshabadi Synchronous Serial Data Transmission ° In Asynchronous data transmission TX and RX clocks are unsynchronised Inefficient (for each 7 bits we send 3 – 4 extra bits) Synhronisation across characters ° In Synchronous Data Transmission TX and RX clocks are synchronised A common shared clock, (I 2 C), or clocking information embedded in the data stream (USB, Ethernet) Fast (many bytes send before a re-synchronisation) Synchronisation across frames vs characters Start 7-bit data stop one char one frame Start Asy Syn

COMP3221 lec29-io-examples-I.18 Saeid Nooshabadi Serial Data Channels on AT91 on DSLMU Board ° Two Universal Synchronous Asynchronous Receiver Transmitter (USART) Programmable Baud rate Can generate interrupts To processor

COMP3221 lec29-io-examples-I.19 Saeid Nooshabadi DSLMU/KOMODO Serial I/Os °DSLMU Serial Port 1: memory-mapped terminal (Connected to the PC for program download and debugging) Read from PC Keyboard (receiver); 2 device regs Writes to PC terminal (transmitter); 2 device regs Received Byte Receiver Data 0x Unused ( ) (IE)Receiver Status 0x Ready Unused ( ) Transmitted Byte Transmitter Status 0x Transmitter Data 0x Ready Unused ( ) Unused

COMP3221 lec29-io-examples-I.20 Saeid Nooshabadi DSLMU/Komodo Serial I/Os °Status register rightmost bit (0): Ready Receiver: Ready==1 means character in Data Register not yet been read (or ready to be read); 1  0 when data is read from Data Reg Transmitter: Ready==1 means transmitter is ready to accept a new character; 0  Transmitter still busy writing last char °Data register rightmost byte has data Receiver: last char from keyboard; rest = 0 Transmitter: when write rightmost byte, writes char to display

COMP3221 lec29-io-examples-I.21 Saeid Nooshabadi DSLMU/KOMODO Serial I/Os Interrupts °IRQ Enable : Enables individual interrupts °IRQ Status: Indicates rasing interrupt. °When a char is received or sent an interrupt is raised

COMP3221 lec29-io-examples-I.22 Saeid Nooshabadi Asyn. Serial Communication Standard (RS232C) °Standard for communication of ASCII-coded character data between devices such as data computers and modems Low speed and cheap °Standard definition: The voltages used to represent 0 and 1 (Electrical) The rate at which data is sent. The format of the data sent. The connectors to be used (physical and mechanical) Extra control signals that may be used. °Typical data rate ((baud rate) are: 75, 300, 1200, 2400, 9600, and 115,000 bits/sec °Typical frame: ASCII Character “S”

COMP3221 lec29-io-examples-I.23 Saeid Nooshabadi RS232C Definitions °The parity bit: is used as an error check. The total number of ‘1’s in the character+parity is made either odd (odd parity) or even (even parity). Any single-bit error makes the parity bit appear wrong. °The stop bit(s): exist to allow for the case where one frame is transmitted immediately after another. The stop bits, which are always 1, ensure the next start bit’s 1  0 transition. (1, 11/2 or 2 bits) °Voltage values: >±5 should be used (Normally >±13 used) +5 represents logic low (space) and –5 logic high (mark) °Physical characteristic: 25 way connector, (9 way is more popular now)

COMP3221 lec29-io-examples-I.24 Saeid Nooshabadi From UART to RS232-C °The UART is responsible for certain parts in RS232-C standard specifications: framing and transmitting TX data receiving and extracting the RX data baud rate generation °The electrical signaling is handled by a driver logic inversion and voltage translation R232 Interface in DSLMU

COMP3221 lec29-io-examples-I.25 Saeid Nooshabadi Non Standard RS-232 Standard ° RS-232 has earned the distinction of being the most non-standard standard in electronics!. in general, two RS-232 devices, when connected together, won't work. ° RS-232 was designed for connecting DTEs ("data terminal equipment") (like PC) to DCEs ("data communication equipment") (like modem). ° A DTE has a male and a DCE a female connector Corresponding pins in DTE connector connect to corresponding pins in DCE connector. ° The IBM PC looks like a DTE with a male connector ° The DSLUM board also looks like a DTE with a male connector ° How to connect PC to DSLMU? Use "null modem“; cable that crosses TxD and RxD wires.

COMP3221 lec29-io-examples-I.26 Saeid Nooshabadi Reading Material °Reading Material: htmhttp:// htm Hardware Reference Manual on CD-ROM

COMP3221 lec29-io-examples-I.27 Saeid Nooshabadi “And In Conclusion” °Parallel Interfacing Fast but expensive °Serial Interfacing Slow but inexpensive °Synchronous Serial Interfacing Fast and more efficient but requires clock synchronisation °Asynchronous Serial Interfacing Slower and less efficient but does not require clock synchronisation °RS232 Standard The most widely used serial communication standard for communication between DTE and DCE devices