1 / 156

Serial Communication

Serial Communication. Data Communications. Data communications refers to the ability of one computer to exchange data with another computer or a peripheral

cellington
Download Presentation

Serial Communication

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Serial Communication

  2. Data Communications • Data communications refers to the ability of one computer to exchange data with another computer or a peripheral • Physically, the data comm. path may be a short, 5 to 10 feet ribbon cable connecting a microcomputer and parallel printer; or it might be a high speed telecommunications port connecting two computers thousands of miles apart. • Standard data communication interfaces and standards are needed • Centronic’s parallel printer interface • RS-232 defines a serial communications standard • We focus on serial I/O this week • 8251 USART (Universal Synchronous/Asynchronous Receiver/Transmitter) is the key component for converting parallel data to serial form and vice versa • Two types of serial data communications are widely used • Asynchronous communications • Synchronous communications

  3. Types of Transmission

  4. 8251A programmable Communication Interface

  5. Introduction • 8251A is a USART (Universal Synchronous Asynchronous Receiver Transmitter) for serial data communication. • Programmable peripheral designed for synchronous /asynchronous serial data communication, packaged in a 28-pin DIP. • Receives parallel data from the CPU & transmits serial data after conversion. • Also receives serial data from the outside & transmits parallel data to the CPU after conversion.

  6. Pin diagram

  7. Block diagram of the 8251 USART

  8. Sections of 8251A • Data Bus buffer • Read/Write Control Logic • Modem Control • Transmitter • Receiver 1.Data Bus Buffer • D0-D7 : 8-bit data bus used to read or write status, command word or data from or to the 8251A

  9. 2. Read/Write Control logic • Includes a control logic, six input signals & three buffer registers: Data register, control register & status register. • Control logic : Interfaces the chip with MPU, determines the functions of the chip according to the control word in the control register & monitors the data flow.

  10. Input signals • CS – Chip Select : When signal goes low, the 8251A is selected by the MPU for communication. • C/D – Control/Data : When signal is high, the control or status register is addressed; when it is low, data buffer is addressed. (Control register & status register are differentiated by WR and RD signals) • WR : When signal is low, the MPU either writes in the control register or sends output to the data buffer. • RD : When signal goes low, the MPU either reads a status from the status register or accepts data from data buffer. • RESET : A high on this signal reset 8252A & forces it into the idle mode. • CLK : Clock input, usually connected to the system clock for communication with the microprocessor.

  11. Control Register • 16-bit register for a control word consist of two independent bytes namely mode word & command word. • Mode word : Specifies the general characteristics of operation such as baud, parity, number of bits etc. • Command word : Enables the data transmission and reception. • Register can be accessed as an output port when the Control/Data pin is high.

  12. Status register • Checks the ready status of the peripheral. • Status word in the status register provides the information concerning register status and transmission errors. Data register • Used as an input and output port when the C/D is low

  13. 3. Modem Control • DSR - Data Set Ready : Checks if the Data Set is ready when communicating with a modem. • DTR - Data Terminal Ready : Indicates that the device is ready to accept data when the 8251 is communicating with a modem. • CTS - Clear to Send : If its low, the 8251A is enabled to transmit the serial data provided the enable bit in the command byte is set to ‘1’. • RTS - Request to Send Data : Low signal indicates the modem that the receiver is ready to receive a data byte from the modem.

  14. 4. Transmitter section • Accepts parallel data from MPU & converts them into serial data. • Has two registers: • Buffer register : To hold eight bits • Output register : To convert eight bits into a stream of serial bits.

  15. The MPU writes a byte in the buffer register. • Whenever the output register is empty; the contents of buffer register are transferred to output register. • Transmitter section consists of three output & one input signals • TxD - Transmitted Data Output : Output signal to transmit the data to peripherals • TxC - Transmitter Clock Input : Input signal, controls the rate of transmission. • TxRDY - Transmitter Ready : Output signal, indicates the buffer register is empty and the USART is ready to accept the next data byte. • TxE - Transmitter Empty : Output signal to indicate the output register is empty and the USART is ready to accept the next data byte.

  16. Input Register Receive Buffer Receive control 5. Receiver Section • Accepts serial data on the RxD pin and converts them to parallel data. • Has two registers : • Receiver input register • Buffer register RxD RxRDY RxC

  17. When RxD goes low, the control logic assumes it is a start bit, waits for half bit time, and samples the line again. If the line is still low, the input register accepts the following data, and loads it into buffer register at the rate determined by the receiver clock. • RxRDY - Receiver Ready Output: Output signal, goes high when the USART has a character in the buffer register & is ready to transfer it to the MPU. • RxD - Receive Data Input : Bits are received serially on this line & converted into a parallel byte in the receiver input register. • RxC - Receiver Clock Input : Clock signal that controls the rate at which bits are received by the USART.

  18. DMA Controller 8237

  19. Introduction • The DMA I/O technique provides direct access to the memory while the microprocessor is temporarily disabled. • This chapter also explains the operation of disk memory systems and video systems that are often DMA-processed. • Disk memory includes floppy, fixed, and optical disk storage. Video systems include digital and analog monitors.

  20. 13–1  BASIC DMA OPERATION • Two control signals are used to request and acknowledge a direct memory access (DMA) transfer in the microprocessor-based system. • the HOLD pin is an input used to request aDMA action • the HLDA pin is an output that acknowledgesthe DMA action • Figure 13–1 shows the timing that is typically found on these two DMA control pins.

  21. Figure 13–1  HOLD and HLDA timing for the microprocessor. • HOLD is sampled in any clocking cycle • when the processor recognizes the hold, it stops executing software and enters hold cycles • HOLD input has higher priority than INTR or NMI • the only microprocessor pin that has a higher priority than a HOLD is the RESET pin

  22. HLDA becomes active to indicate the processor has placed its buses at high-impedance state. • as can be seen in the timing diagram, there area few clock cycles between the time that HOLD changes and until HLDA changes • HLDA output is a signal to the requesting device that the processor has relinquished control of its memory and I/O space. • one could call HOLD input a DMA requestinput and HLDA output a DMA grant signal

  23. Basic DMA Definitions • Direct memory accesses normally occur between an I/O device and memory without the use of the microprocessor. • a DMA read transfers data from the memoryto the I/O device • A DMA write transfers data from an I/O deviceto memory • Memory & I/O are controlled simultaneously. • which is why the system contains separate memory and I/O control signals

  24. A DMA read causes the MRDC and IOWC signals to activate simultaneously. • transferring data from memory to the I/O device • A DMA write causes the MWTC and IORC signals to both activate. • 8086/8088 require a controller or circuit such as shown in Fig 13–2 for control bus signal generation. • The DMA controller provides memory with its address, and controller signal (DACK) selects the I/O device during the transfer.

  25. Figure 13–2  A circuit that generates system control signals in a DMA environment.

  26. Data transfer speed is determined by speed of the memory device or a DMA controller. • if memory speed is 50 ns, DMA transfers occurat rates up to 1/50 ns or 20 M bytes per second • if the DMA controller functions at a maximum rate of 15 MHz with 50 ns memory, maximum transfer rate is 15 MHz because the DMA controller is slower than the memory • In many cases, the DMA controller slows the speed of the system when transfers occur.

  27. The switch to serial data transfers in modern systems has made DMA is less important. • The serial PCI Express bus transfers data at rates exceeding DMA transfers. • The SATA (serial ATA) interface for disk drives uses serial transfers at the rate of 300 Mbps • and has replaced DMA transfers for hard disks • Serial transfers on main-boards between components using can approach 20 Gbps for the PCI Express connection.

  28. 13–2  THE 8237 DMA CONTROLLER • The 8237 supplies memory & I/O with control signals and memory address information during the DMA transfer. • actually a special-purpose microprocessorwhose job is high-speed data transfer between memory and I/O • Figure 13–3 shows the pin-out and block diagram of the 8237 programmable DMA controller.

  29. Figure 13–3  The 8237A-5 programmable DMA controller. (a) Block diagram and (b) pin-out. (Courtesy of Intel Corporation.)

  30. 8237 is not a discrete component in modern microprocessor-based systems. • it appears within many system controller chip sets • 8237 is a four-channel device compatiblewith 8086/8088, adequate for small systems. • expandable to any number of DMA channel inputs • 8237 is capable of DMA transfers at rates up to 1.6M bytes per second. • each channel is capable of addressing a full64K-byte section of memory and transfer up to 64K bytes with a single programming

  31. 8237 Pin Definitions CLK • Clock input is connected to the system clock signal as long as that signal is 5 MHz or less. • in the 8086/8088 system, the clock must be inverted for the proper operation of the 8237

  32. 8237 Pin Definitions CS • Chip select enables 8237 for programming. • The CS pin is normally connected to the output of a decoder. • The decoder does not use the 8086/8088 control signal IO/M(M/IO) because itcontains the new memory and I/O control signals (MEMR, MEMW, IOR and IOW).

  33. 8237 Pin Definitions RESET • The reset pin clears the command, status, request, and temporary registers. • It also clears the first/last flip-flop and setsthe mask register. • this input primes the 8237 so it is disableduntil programmed otherwise

  34. 8237 Pin Definitions READY • A logic 0 on the ready input causes the8237 to enter wait states for slowermemory components. HLDA • A hold acknowledge signals 8237 that the microprocessor has relinquished control ofthe address, data, and control buses.

  35. 8237 Pin Definitions DREQ0–DREQ3 • DMA request inputs are used to request a transfer for each of the four DMA channels. • the polarity of these inputs is programmable, sothey are either active-high or active-low inputs DB0–DB7 • Data bus pins are connected to the processor data bus connections and used during the programming of the DMA controller.

  36. 8237 Pin Definitions IOR • I/O read is a bidirectional pin used during programming and during a DMA write cycle. IOW • I/O write is a bidirectional pin used during programming and during a DMA read cycle.

  37. 8237 Pin Definitions EOP • End-of-process is a bidirectional signalused as an input to terminate a DMA process or as an output to signal theend of the DMA transfer. • often used to interrupt a DMA transfer atthe end of a DMA cycle

  38. 8237 Pin Definitions A0–A3 • These address pins select an internalregister during programming and providepart of the DMA transfer address during a DMA action. • address pins are outputs that provide part ofthe DMA transfer address during a DMA action

  39. 8237 Pin Definitions HRQ • Hold request is an output that connects tothe HOLD input of the microprocessor inorder to request a DMA transfer.

  40. 8237 Pin Definitions DACK0–DACK3 • DMA channel acknowledge outputs acknowledge a channel DMA request. • These outputs are programmable as either active-high or active-low signals. • DACK outputs are often used to select the DMA- controlled I/O device during the DMA transfer.

  41. 8237 Pin Definitions AEN • Address enable signal enables the DMA address latch connected to the DB7–DB0pins on the 8237. • also used to disable any buffers in thesystem connected to the microprocessor

  42. 8237 Pin Definitions ADSTB • Address strobe functions as ALE, exceptit is used by the DMA controller to latchaddress bits A15–A8 during the DMA transfer. MEMR • Memory read is an output that causes memory to read data during a DMA read cycle.

  43. 8237 Pin Definitions MEMW • Memory write is an output that causes memory to write data during a DMA write cycle.

  44. 8237 Internal Registers CAR • The current address register holds a 16-bit memory address used for the DMA transfer. • each channel has its own current addressregister for this purpose • When a byte of data is transferred during a DMA operation, CAR is either incrementedor decremented. • depending on how it is programmed

  45. 8237 Internal Registers CWCR • The current word count register programsa channel for the number of bytes (up to 64K) transferred during a DMA action. • The number loaded into this register is one less than the number of bytes transferred. • for example, if a 10 is loaded to CWCR, then 11 bytes are transferred during the DMA action

  46. 8237 Internal Registers BA and BWC • The base address (BA) and base word count (BWC) registers are used whenauto-initialization is selected for a channel. • In auto-initialization mode, these registersare used to reload the CAR and CWCRafter the DMA action is completed. • allows the same count and address to be usedto transfer data from the same memory area

  47. 8237 Internal Registers CR • The command register programs the operation of the 8237 DMA controller. • The register uses bit position 0 to select the memory-to-memory DMA transfer mode. • memory-to-memory DMA transfers use DMA channel 0 to hold the source address • DMA channel 1 holds the destination address • Similar to operation of a MOVSB instruction.

  48. Figure 13–4  8237A-5 command register. (Courtesy of Intel Corporation.)

  49. 8237 Internal Registers MR • The mode register programs the mode of operation for a channel. • Each channel has its own mode register as selected by bit positions 1 and 0. • remaining bits of the mode registerselect operation, auto-initialization, increment/decrement, and mode for the channel

  50. Figure 13–5  8237A-5 mode register. (Courtesy of Intel Corporation.)

More Related