CPE412-ES-Module 4 - Parallel Input and Output.pdf
Document Details
Uploaded by BullishElder8596
USTP
2024
Tags
Full Transcript
CPE412 Embedded Systems Module No. 4 Topic Parallel Input and Output Period Week no. __5__ : Date __September 9-14, 2024__ PARALLEL INPUT AND OUTPUT Describing Parallel...
CPE412 Embedded Systems Module No. 4 Topic Parallel Input and Output Period Week no. __5__ : Date __September 9-14, 2024__ PARALLEL INPUT AND OUTPUT Describing Parallel Input and Output Types of Parallel Ports The Technical Challenge of Parallel Input/Output Examples of Parallel Input/Output Objective/Intended Learning Outcomes Explain the concept of PIO in embedded systems and its significance in various applications. Identify the types of parallel ports and its utilization in the embedded systems. Describe the technical challenges of parallel input/output and the examples of parallel I/O in embedded systems. Discussion/Content 4. PARALLEL INPUT AND OUTPUT INTRODUCTION Embedded systems, often hidden from plain view, are the unsung heroes of the modern technological landscape. These specialized computer systems, integrated into various devices and machinery, rely on effective communication as a linchpin for their operation and functionality. The significance of communication in embedded systems cannot be overstated, as it underpins their capacity to interact with the world, make decisions, and fulfill their intended purposes. As what discussed from previous lessons, embedded systems are inherently designed to interact with external devices. Whether it's reading data from sensors, controlling actuators, or displaying information on screens, these systems depend on communication to exchange data and instructions with these external components. Without this interaction, they would be isolated and ineffectual. There are two fundamental types of communication interfaces are parallel and serial communication, each with its own characteristics and applications. This lesson will be focusing on the idea of parallel input/output, the technical challenge in digital input/output, its types of ports, and the uses of the parallel I/O in embedded systems. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 1 DESCRIBING PARALLEL INPUT AND OUTPUT Almost any embedded system needs to transfer digital data between its CPU and the outside world. This transfer falls into a number of categories, which can be summarised as: Direct user interface, including switches, keypads, light-emitting diodes (LEDs) and displays. Input measurement information, from external sensors, possibly being acquired through an analog-to-digital converter. Output control information, for example to motors or other actuators. Bulk data transfer to or from other systems or subsystems, moving in serial or parallel form, for example sending serial data to an external memory. With this plethora of data coming and going, it is likely to need to have a variety of digital inputs and/or outputs. Interfacing the electronic system allows the electronic circuit or system to communicate internally and externally. The communications interface allows the transmission of either analogue signals or digital data. A system that transmits data to and receives data from an external source is shown in Figure 1. Figure 1. Data transmission and receipt Each electronic system communicates with other systems by transmitting data via a transmitter (Tx) subsystem and receives data via a receiver (Rx) subsystem. The medium between the two systems is the communications channel. However, when analogue signals or digital data are transmitted through the communications channel, noise might be added to the signal, potentially corrupting the data. A great deal of care must be taken to ensure that the electronic systems do not use corrupted information. Although information can be sent or received as analogue signals or digital data, digital data transmission is increasingly common and are divided broadly into either serial or parallel data transmission. In serial data transfer, the information is transferred one bit at a time (a serial bitstream). Only a single interconnection is used to carry the data itself, although other lines are usually included for synchronization and control. Serial data transmission takes longer, but when the data is transmitted on electrical wires (typically copper wires), fewer wires are required than with the parallel data transmission. Serial data transmission also lends itself to data transmission via optical fibers and wireless methods. In parallel data transfer, a set (for example, eight) of interconnections is used. Each of these can carry 1 bit, and each works in parallel with the others. Data can thus be transferred in groups of bits, for example in bytes. Parallel input/output (I/O) is the workhorse for all the basic data interchange of a microcontroller, including interfacing with switches, LEDs, displays and so on. A group of parallel I/O interconnections, appearing on the pins of the microcontroller, is called a ‘parallel port’. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 2 TYPES OF PARALLEL PORTS Parallel I/O allows groups of data bits to be transmitted simultaneously. In early versions of the microprocessor, data was grouped into bytes (8 bits). Today, microprocessors work with 8, 16, 32, 64, and 128 bits of data. Access to more memory requires address buses with an increased number of bits and the required control signals. The variety of parallel I/O standards available for use today include: Centronics (PC printer port) IEEE 488-1975, also known as GPIB (General Purpose Instrument Bus) SCSI (Small Computer System Interface) IDE (Integrated Drive Electronics) PCI: Peripheral Component Interface PC Parallel Port (Centronics) The PC parallel port (by Centronics) was until recently the port used primarily to connect the PC [20, 21] to a printer device, as shown in Figure 2. Here, each device is fitted with a 36-pin connector, and byte-wide data are sent from the PC to the printer (the peripheral) with handshaking—i.e., both the PC and the peripheral communicate with each other to control data transmission to be at a time suitable for both. Centronics ports were widely used in early personal computers, providing a standard way to connect dot matrix and later inkjet and laser printers. These ports supported unidirectional communication, primarily for sending print data from the computer to the printer. Figure 2. Connecting a PC to a printer using the parallel port That means, parallel input/output (I/O) in embedded systems refers to the simultaneous transfer of multiple bits or data between the microcontroller or microprocessor and external devices. A parallel port is a port for parallel communication. Parallel communication means that multiple bits can communicate over a set of parallel lines at any given instance. A parallel port communicates within the same board, between ICs or wires over very short distances of at most less than a meter. Figure 3. Transfer of multiple data bits in parallel communication Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 3 Table 1: Centronics (printer) port signals (PC connector) Table 1 identifies the cable connections for the Centronics printer port. Signals are transmitted on a twisted- pair (i.e., two wires twisted together) with its own common connection. Signal directions are shown from the perspective of the PC rather than the peripheral. Today, the parallel port connection to the printer is usually replaced by a USB interface IEEE 488-1975 In the early 1970's, Hewlett-Packard came out with a standard bus (HP-IB) to help support their own laboratory measurement equipment product lines, which later was adopted by the IEEE in 1975. This is known as the IEEE Std. 488-1975. The IEEE 488, commonly known as GPIB (General Purpose Instrument Bus) or HPIB (Hewlett-Packard Interface Bus), is a standard interface for connecting test and measurement devices such as oscilloscopes, multimeters, and signal generators. It uses a 24-pin connector and is characterized by its daisy-chaining capability, allowing multiple devices to be connected in a single chain. Figure 4. IEEE 488, commonly known as GPIB GPIB is known for its reliability and robustness in laboratory and industrial settings, providing bidirectional communication and control of instruments. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 4 SCSI (Small Computer System Interface) SCSI is a parallel interface standard used for connecting various peripheral devices to computers, including hard drives, CD-ROM drives, scanners, and printers. It uses a range of connectors, including DB-25, HD- 50, and Micro-D, depending on the specific SCSI generation. Figure 5. Small Computer System Interface SCSI offers high-speed data transfer and the ability to daisy-chain multiple devices, making it suitable for applications that require fast and reliable data access. IDE (Integrated Drive Electronics) IDE, also known as Parallel ATA (PATA - Parallel Advanced Technology Attachment), is an older parallel interface primarily used for connecting hard disk drives and CD/DVD drives to computers. IDE cables typically have a 40-pin connector and support two devices (master and slave) on a single channel. Figure 6. IDE, also known as Parallel ATA (PATA) IDE interfaces have largely been replaced by SATA (Serial ATA) for modern storage devices due to SATA's faster data transfer rates. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 5 PCI (Peripheral Component Interface) PCI is a standard bus architecture used for connecting expansion cards and peripherals to desktop computers and servers. It comes in several variations, including PCI, PCI-X, and PCI Express (PCIe), each with different data transfer rates and form factors. Figure 7. Peripheral Component Interface PCI cards are used to add functionality to a computer, such as graphics, network adapters, sound cards, and more. These interfaces have played significant roles in the evolution of computer and electronics connectivity, with some of them, such as GPIB and SCSI, continuing to find application in specialized industries and laboratories. Parallel I/O is a viable option in embedded systems when high-speed data transfer is required, but it comes with challenges related to complexity, signal integrity, and power consumption. Engineers must carefully consider the trade-offs between parallel and serial communication based on the specific requirements of their embedded system design. Parallel communication, before the introduction of the USB standard, was much more common to see in everyday applications. From plugging in a printer to connecting an external monitor, parallel style communication was used almost exclusively with older PCs. The reason this standard was adapted so widely was because it generally is a fast standard to work with. Since data packets are sent simultaneously more data can be transferred in a shorter period of time. If using byte-level communication, parallel data can send 1 byte eight times faster than serial communication. However, as cables became longer, and applications became more data-heavy parallel communication started to see some limitations. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 6 THE TECHNICAL CHALLENGE OF PARALLEL INPUT/OUTPUT Cross Talk A common issue that engineers run into when working with wires is the issue of cross talk between the data lines. Cross talk, or noise, is caused by electromagnetic signals affecting another electronic signal. This is very common when wires are too close to one another. Cross talk distorts data and causes errors when present. Figure 8. Illustration of Cross talk on electrical wires Limitations at High Frequencies and Long Ranges Another issue that arises with parallel communication happens at high-frequency data transfers. At higher frequencies, it is common for bits to get jumbled and arrive at the receiving device at different times. This is problematic since parallel requires that all bits of data are received at the same time. The receiver is required to slow down the messages to wait for all data packets to arrive before accepting the full data packet. If this happens it is common for the receiver to get backed up. If it cannot accept all the messages at a time, due to lagging bits of data, the incoming bits may run into the waiting packets, causing additional issues. Parallel excels when used is short distance applications. Pins Susceptible to Damage Another issue that arises when using connector heads with visible pins is the high potential for damage. A very common issue that people experience, especially with old printers, is the bending of connector pins when trying to connect devices. Lining up the pins in a connector like this can be difficult and requires more attention. Typical USB cables do not have this issue since there are no visible pins in the design. Greater Physical Footprint Space is one of the most valuable aspects of any modern-day PCB or device design. As designs get smaller, input and output connectors must also get smaller. Since parallel ports require individual pins for their connection, the space needed on a PCB or device gets bigger as more pins are added. This space requirement why it is very rare to see these types of ports on modern-day computers and monitors. There has been an adoption of smaller, serial style ports to save space and size. More Expensive Parallel cables and connectors are also more expensive to make and implement than their serial counterpart. Since more wires are needed for the application, each wire adds to the overall cost of development. In parallel data communication, upwards of 34 wires can be needed for some of the more advanced operations. The difference between 1 and 34 wires can be exponentially more expensive and is often a huge factor in deciding to go with a serial vs parallel for an application. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 7 SIGNIFICANCE OF PARALLEL I/O IN EMBEDDED SYSTEMS Parallel Input/Output (Parallel I/O) is significant in embedded systems for various reasons, as it offers distinct advantages and is well-suited for specific applications. Here are some of the key significances of parallel I/O in embedded systems: High Data Throughput – Parallel I/O allows for the simultaneous transfer of multiple bits (typically 8, 16, or 32 bits) in parallel, resulting in significantly higher data throughput compared to serial I/O. This is crucial in applications where fast data exchange is required, such as video processing, high- speed data acquisition, and real-time control systems. Low Latency – The parallel nature of data transfer in parallel I/O reduces latency, making it ideal for applications that require immediate responses and real-time processing. In embedded systems like robotics and automation, low latency is essential for ensuring timely control commands. Direct Memory Access (DMA) – Many embedded systems employ DMA controllers to transfer data between memory and peripherals directly. Parallel I/O interfaces, such as parallel buses, are well-suited for DMA operations, enabling efficient data transfers without CPU intervention. Simplicity for Parallel Interface – Certain peripheral devices, such as memory chips (e.g., SRAM and DRAM), graphic displays, and image sensors, are designed to work with parallel interfaces. Using parallel I/O simplifies the interfacing of these components with the embedded system. Synchronization – Parallel I/O can offer precise synchronization, which is important in applications that require multiple devices to coordinate their actions. Examples include data acquisition systems, where sensors need to be sampled simultaneously. High-Performance Computing – In some embedded systems, especially those used in scientific or engineering applications, parallel I/O is essential for high-performance computing tasks like simulations, signal processing, and numerical calculations. Legacy Support – In many cases, embedded systems need to interface with legacy hardware that relies on parallel interfaces. Parallel I/O allows for seamless integration with older equipment without the need for complex signal conversion. Customization – Parallel I/O can be customized to meet specific application requirements. Embedded system designers can tailor the parallel communication protocol to match the needs of the system, optimizing performance and resource usage. Reduced Overhead – In situations where a significant amount of data needs to be transferred between the embedded system and peripherals, parallel I/O can reduce the overhead associated with serial communication protocols, such as start and stop bits, by transmitting multiple bits simultaneously. Cost-Effective – In some cases, parallel I/O can be a cost-effective solution for embedded systems that require high-speed data transfer. It eliminates the need for additional hardware (such as serializers and deserializers) that may be required in serial communication setups. Despite its advantages, parallel I/O also has some drawbacks, such as increased wiring complexity, greater susceptibility to noise and signal integrity issues, and a larger physical footprint. Therefore, the choice of using parallel I/O in an embedded system depends on the specific requirements and constraints of the application, including the need for high-speed data transfer and real-time performance. Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 8 EXAMPLES OF PARALLEL PORTS I/O A parallel port can have one or multibit input or output and cane be a bi-directional IO. The following are the classification of IO devices into various types with examples of each type. Parallel Port single bit input – Completion of a revolution of a wheel, – Achieving preset pressure in a boiler, – Exceeding the upper limit of permitted weight over the pan of an electronic balance, – Presence of a magnetic piece in the vicinity of or within reach of a robot arm to its end point and – Filling of a liquid up to a fixed level. Parallel Port Output- single bit – PWM output for a DAC, which controls liquid level, or temperature, or pressure, or speed or angular position of a rotating shaft or a linear displacement of an object or a d.c. motor control – Pulses to an external circuit – Control signal to an external circuit Parallel Port Input- multi-bit – ADC input from liquid level measuring sensor or temperature sensor or pressure sensor or speed sensor or d.c. motor rpm sensor – Encoder inputs for bits for angular position of a rotating shaft or a linear displacement of an object Parallel Port Output- multi-bit – LCD controller for Multilane LCD display matrix unit in a cellular phone to display on the screen the phone number, time, messages, character outputs or pictogram bit-images for display screen or e-mail or web page. – Print controller output. – Stepper-motor coil driving bits Parallel Port Input-Output – PPI 8255 – Touch screen in mobile phone References Modern Embedded Computing by Peter Barry and Patrick Crowley Embedded System Design 4th Edition by Peter Marwedel Embedded Systems - Theory and Design Methodology by Kiyofumi Tanaka Introduction to Embedded Systems 2nd Edition by Lee and Seshia High Performance Embedded Computing by Pinho et. al. Introduction to Embedded Systems by Shibu KV Created by: CPE412 1ST SEMESTER USTP INSTRUCTORS 9