Peripheral Devices PDF
Document Details
Uploaded by ResilientSerpentine1287
Tags
Summary
This document discusses peripheral devices, their types, and how they connect to computers. It covers various methods of input/output, including programmed I/O, interrupt-driven I/O, and DMA. It also explains the concepts of interrupts and exceptions related to peripheral device operations.
Full Transcript
Peripheral Devices Peripheral devices are devices that connect to the core computing unit, providing input/output functions for a computer and serving as an auxiliary computer device without computing-intensive functionality They can be classified into three basic categories: 1. Input Devices...
Peripheral Devices Peripheral devices are devices that connect to the core computing unit, providing input/output functions for a computer and serving as an auxiliary computer device without computing-intensive functionality They can be classified into three basic categories: 1. Input Devices: These devices convert incoming data and instructions into a pattern of electrical signals in binary code that are comprehensible to a digital computer. Examples include keyboards, mice, scanners, and microphones 2. Output Devices: These devices provide a specific output and may have a storage device for storing information or data. Examples include printers, speakers, and displays 3. Communication Devices: These devices facilitate communication between the computer and other devices or systems. Examples include modems, network adapters, and USB drives Types of Peripheral Devices Peripheral devices can be connected to a computer system in various ways, including: Programmed I/O: This method involves using I/O instructions written in the computer program, with each data item transfer initiated by an instruction in the program Interrupt-initiated I/O: This method involves the CPU being interrupted by external devices, allowing them to transfer data with the CPU Direct Memory Access (DMA): This method allows certain hardware subsystems to access main system memory independently of the central processing unit I/O Sub-system and Transfer The I/O sub-system is responsible for transferring data between the computer system and external devices. It uses special communication links and hardware components called interface units to supervise and synchronize input and output transfers The CPU initializes the DMA controller with a count of the number of words to transfer and the memory address to use, and the DMA controller then provides addresses and read/write control lines to the system memory DMA Direct Memory Access (DMA) is a feature of computer systems that allows certain hardware subsystems to access main system memory independently of the central processing unit This method is used to transfer data between a CPU and external I/O devices, such as hard drives, printers, and network adapters Interrupt and Exception Interrupts are signals generated by external devices or the system itself that cause the CPU to temporarily stop its current task and execute a specific program or routine. Exceptions are conditions that arise during the execution of a program, causing the CPU to pause and potentially change the program's flow When peripheral devices are used in computer operations, there are various exceptions that can arise. These exceptions can be related to hardware problems, failures in the operating system settings, damaged libraries, user input errors, and invalid data. Some examples of exceptions when peripheral devices are used in computer operations include: 1. Hardware Interrupts: These are program control interruptions caused by external hardware events. Hardware interrupts usually come from many different sources such as timer chips, peripheral devices (keyboards, mouse, etc.), I/O ports (serial, parallel, etc.), disk drives, CMOS clock, and expansion cards (sound card, video card, etc). 2. Software Exceptions: Exceptions are software interrupts that can be identified as a special handler routine. They can occur when there is an abnormal event in the program, such as divide by zero or illegal memory location. Exceptions are synchronous internal requests for service based upon abnormal events. 3. Incompatibility: If the USB port and device are incompatible, attached peripherals will not work. Incompatibility issues can arise when using legacy or USB peripherals, and can cause peripherals to stop working following an update. 4. Error with Wireless Keyboard or Mouse: Problems can arise with wireless peripherals such as keyboards or mice. These issues can be related to connectivity, battery life, or driver problems. 5. Port Problems: If attached peripherals suddenly stop working, it is important to check the device port for any physical damage or loose connections. Port problems can cause peripherals to malfunction or stop working altogether. Interrupts and exceptions are both related to unanticipated events that can occur during the execution of a program, but they have different characteristics and are used for different purposes. Interrupts are typically generated by peripheral devices to signal the processor to perform a specific task, while exceptions can be generated by software or hardware interrupts, typically due to a peripheral device needing to send or receive data. Both interrupts and exceptions are handled by the operating system, but they have different handling mechanisms and priorities. Privileged and Non-Privileged Instructions In an operating system, instructions are divided into two categories: privileged and non-privileged instructions. 1. Privileged instructions can only be executed by the operating system kernel or a privileged process, such as a device driver, and are used for operations that require direct access to hardware or other privileged resources 2. Non-privileged instructions can be executed by any process and are used for general-purpose computing tasks Examples of privileged instructions: Setting up memory mappings: Privileged instructions are used to set up memory mappings, which involves direct access to system resources. Accessing I/O devices: Privileged instructions can access I/O devices directly, allowing the operating system to control device functions and communication. Modifying control registers: Privileged instructions can modify control registers, which are used to configure hardware components and their settings. Handling exceptions: Exception handlers use privileged instructions to deal with exceptions, as they access the Control Structure Registers (CSRs) that handle exceptions. Executing device-specific instructions: Device drivers, such as graphics drivers or network drivers, may require privileged instructions to control device-specific functions and resources. Privileged instructions are executed in kernel mode, which provides unrestricted access to system resources. They are essential for the proper functioning of the operating system and device drivers, as they allow the system to perform low-level operations and access resources that are not available to user-level processes. Non-privileged instructions are instructions that can be executed by any process and are used for general-purpose computing tasks. Examples of non-privileged instructions: Arithmetic instructions: These instructions perform arithmetic operations such as addition, subtraction, multiplication, and division. Logical instructions: These instructions perform logical operations such as AND, OR, and NOT. Data transfer instructions: These instructions move data between memory locations or between memory and registers. Control transfer instructions: These instructions change the flow of program execution, such as jump, branch, and call instructions. Input/output instructions: These instructions perform input/output operations, such as reading from or writing to a file or device. Non-privileged instructions are executed in user mode, which provides limited access to system resources and ensures that processes cannot interfere with one another. The distinction between privileged and non-privileged instructions is an important mechanism for ensuring the security and stability of an operating system. The method that is used to transfer information between internal storage and external I/O devices is known as I/O interface. The CPU is interfaced using special communication links by the peripherals connected to any computer system. These communication links are used to resolve the differences between CPU and peripheral. There exists special hardware components between CPU and peripherals to supervise and synchronize all the input and output transfers that are called interface units. COMMUNICATION DEVICES Bluetooth devices Infrared devices Modem (over phone line) Network card (using Ethernet) Smartphone Wi-Fi devices (using a Wi-Fi router) Bluetooth is a computing and telecommunications industry specification that describes how devices can communicate with each other. Bluetooth devices include computers, keyboards and mice, personal digital assistants, and smartphones. Bluetooth is an RF (radio frequency) technology operating at 2.4 GHz and has an effective range of 32 feet (10 meters), varying by power class, a transfer rate of 1 Mbps, and a throughput of 721 Kbps. Bluetooth headphones - Headphones that connect to any Bluetooth device. Bluetooth keyboard and Bluetooth mouse - Wireless keyboards and mice. Bluetooth speaker - Speakers that connect to any Bluetooth audio device. Bluetooth car - A car with Bluetooth can make hands-free calls in the car. Bluetooth watch or Bluetooth health monitor - Bluetooth wrist devices that transmit data to other devices over Bluetooth. Bluetooth lock - Door lock that lets you remotely lock and unlock a door. Infrared -Method of transferring data using EMR (electromagnetic radiation) and without wires. A common example of a IR (infrared) device is a TV remote. However, infrared is also used with comp uters and devices like a cordless keyboard, cordless mouse, and infrared touch screen. Applications for IR Infrared Touch screens include Kiosk, Medical instrumentation, ATM, Retail, Commercial transportation, Advertising display, Digital Signage and many other industrial applications. Throughput - Alternatively called communication speed, throughput is a value used to illustrate the total amount of data transferred through a computer or device at any time. This number is commonly represented in bits per second (bps) or bytes per second (Bps). Example: throughput of 721 Kbps. Throughput can be calculated across various industries: Example: An automobile manufacturer wants to calculate its throughput. It can produce 100 cars over a 5 day period, therefore it's throughput is 20 cars per day: 20 = 100 / 5 A call center with 50 employees works 8-hour shifts. If a total of 3000 calls were answered over a shift, then the throughput is 7.5 calls per hour per employee: 7.5 = 3000 / (50 employees * 8 hours). A soda company has 3 machines and produces 1800 cans of soda per minute. The soda company's throughput is: 600 cans per minute: 600 = 1800 cans / (3 machines * 1 minute). The variables to be considered in measuring the throughput of peripheral devices, such as USB ports, include: 1. USB Generation: The generation of the USB port (e.g., USB 2.0, USB 3.0, USB 3.1, USB 3.2, USB4) determines the maximum data transfer rate and throughput capabilities of the port. 2. Number of Devices: The total available bandwidth of the USB port is shared among all connected devices. The number and type of devices connected to the port can affect the actual throughput. 3. Type of Devices: Different types of USB devices (e.g., storage devices, input devices, display devices) require different amounts of bandwidth. High-speed devices require more bandwidth than low-speed devices. 4. USB Cable Quality: The quality of the USB cable can affect the actual data transfer rate. A poor- quality cable may introduce signal degradation and reduce the data transfer rate. 5. USB Host Controller: The USB host controller in the computer or device may have a maximum data transfer rate that limits the throughput of the USB port. 6. Protocol Overhead: USB communication protocols introduce overhead that reduces the actual data transfer rate. The protocol overhead can vary depending on the type of USB device and the specific communication protocol used. 7. Data Transfer Size and Type: The size and type of data being transferred can affect the actual throughput of the USB port. Large data transfers may require more bandwidth than small data transfers. 8. System Load: The overall system load, including the CPU, memory, and other devices, can affect the actual throughput of the USB port. High system load may reduce the available bandwidth for USB data transfer. Peripheral devices can be connected to a computer system in various ways, including: Programmed I/O, or Input/Output, refers to the method of data transfer between a computer's central processing unit (CPU) and peripheral devices, where the CPU is responsible for controlling the data transfer process. In Programmed I/O, the CPU issues commands to the peripheral device, and the data transfer occurs under the direct control of the CPU. Here are some examples of peripheral devices that can be connected to a computer system using Programmed I/O: 1. Printers: Dot matrix printers Laser printers Inkjet printers 2. Scanners: Flatbed scanners Document scanners 3. External Hard Drives: USB hard drives Thunderbolt hard drives 4. CD/DVD Drives: External CD/DVD drives connected via USB 5. External Storage Devices: USB flash drives Memory card readers 6. Digital Cameras: Cameras connected to the computer for data transfer 7. Joysticks and Game Controllers: Gaming peripherals that communicate with the computer 8. Network Adapters: Ethernet adapters Wi-Fi adapters 9. USB Devices: Various USB-connected devices such as keyboards, mice, and webcams 10. Serial Devices: Devices connected through serial ports, such as serial printers Serial devices Serial devices are devices that communicate with a computer or other device one bit at a time, in contrast to parallel devices that communicate multiple bits simultaneously in parallel. A serial port is an interface on a computer that allows a serial device to be connected to the computer and transfer or receive data one bit at a time. Serial ports are also known as communication (COM) ports and are usually identified on IBM- compatible computers as COM ports. They are commonly used to connect peripherals such as game controllers and mice to a computer, and they were once used to connect printers and external modems. Serial ports are still used in industrial machinery systems and scientific instruments and are usually found on IBM-compatible computers as COM (communications) ports. The term "serial" comes from the fact that the data is transmitted one bit at a time, and the term "port" refers to the physical interface through which the data is transmitted. Some examples of serial devices include: 1. 3D printers 2. Microcontrollers such as the BBC micro:bit board 3. Sensors for data acquisition 4. Industrial machinery systems 5. Scientific instruments 6. Modems 7. Game controllers 8. Mice 9. Printers (historically) These devices typically communicate with a computer or other device one bit at a time, and they are often connected to a serial port, also known as a communication (COM) port USB The Universal Serial Bus (USB) is an industry standard that has revolutionized the way devices are connected to computers. It was developed to standardize the connection of peripherals to personal computers, both to exchange data and to supply electric power. USB has largely replaced interfaces such as serial ports and parallel ports and has become commonplace on a wide range of devices. USB was first introduced in late 1995, with the vision of providing a standard means of connecting devices, such as joining a printer to a computer. Before USB, the two primary means of connecting one device to another were serial and parallel ports, which often required installing expansion cards and drivers to facilitate the connections. A group of seven companies began the development of USB in 1995, including Compaq, DEC, IBM, Intel, Microsoft, NEC, and Nortel. The goal was to make it fundamentally easier to connect external devices to PCs by replacing the multitude of connectors at the back of PCs, addressing the usability issues of existing interfaces, and simplifying software configuration of all devices connected to USB, as well as permitting greater data transfer rates for external devices and Plug and Play features. SERIAL PORTS vs USB PORTS USB Ports Feature Serial Ports Data Transfer Asynchronous, one bit at a time Synchronous, high-speed data transfer Relatively low speeds, up to 115 High-speed data transfer, up to 40 Gbps Speed kbps (USB4) Dedicated pins for hardware USB connectors, no dedicated pins for flow Connectors flow control control Power Capable of delivering power via USB (USB 1.1, Delivery Not capable of providing power USB 2.0, USB 3.0, USB 3.1 Gen 2) Single-ended, point-to-point Data Bus communication Multi-point, bus-based communication Limited to one-to-one Devices connectivity Supports multiple devices and hubs Data Transfer Year of USB Version Speed Introduction Examples of Technologies USB 1.0 1.5 Mbps 1996 Keyboards, Mice, Printers USB 2.0 480 Mbps 2000 External Hard Drives, Digital Cameras USB 3.0 5 Gbps 2008 Solid State Drives, HD Webcams USB 3.1 10 Gbps 2013 External SSDs, 4K Video Cameras USB 3.2 20 Gbps 2017 High-Performance Storage Devices High-Performance Storage Devices, 4K Video USB 4 40 Gbps 2019 Cameras Here is a table of some examples of devices that use USB 3.0 ports: Device Type Examples Western Digital My Passport, Seagate Backup External Hard Drives Plus Solid State Drives Samsung T5, SanDisk Extreme Pro Flash Drives SanDisk Ultra Flair, Kingston DataTraveler High-Performance Storage Devices LaCie Rugged, G-Technology G-Drive 4K Video Cameras Sony FDR-AX100, Panasonic Lumix GH5 HD Webcams Logitech C922 Pro Stream, Razer Kiyo Device Type Examples External SSDs Samsung Portable SSD T7, Crucial X8 USB Network Adapters TP-Link Archer T4U, Netgear Nighthawk A7000 Multiport USB Hubs Anker 7-in-1 USB-C Hub, HooToo USB C Hub Higher-End Webcams Logitech Brio, Razer Kiyo Pro Different types of computer ports: Port Type Description Examples A serial communication interface through Used for connecting external devices like a which information transfers in or out modem, mouse, or keyboard (basically in Serial Port sequentially one bit at a time. older PCs). An interface through which the communication between a computer and its peripheral device is in a parallel manner i.e. data is transferred in or out in parallel using Parallel Port more than one communication line or wire. Printer port is an example of a parallel port. The Universal Serial Bus (USB) is a widely used standard for connecting peripherals to USB Type-A, USB Type-B, USB Type-C, USB USB Port a computer. 3.0, USB 3.1, USB 3.2, USB4. A 6-pin mini-DIN connector used for Used for connecting old computer PS/2 Port connecting keyboards and mice to a PC. keyboards and mice. Acronym for Video Graphic Array. The most Used for connecting external monitors to a VGA Port common connection for external monitors. computer. A physical interface often used for Used for connecting a PC’s modem to the Modem/RJ11 terminating telephone wires. telephone network. Used for connecting audio and video HDMI High-Definition Multimedia Interface. devices. A physical interface used for connecting a Used for connecting a computer to a Ethernet computer to a local area network (LAN). network. Used for connecting various devices, including smartphones, tablets, and USB-C The newest USB connector type. laptops. Used for connecting audio and video FireWire A high-speed serial bus interface. devices. Port Type Description Examples Used for connecting digital displays to a DVI Port Digital Visual Interface. computer. A type of connector used for audio and Used for connecting audio and video RCA video signals. devices. 3.5mm Used for connecting headphones, Audio A standard audio connector. microphones, and speakers. A wireless type port with a limited range of Used for sending and receiving infrared Infrared Port 5-10ft. signals from other devices. Used previously to connect a joystick to a Used for connecting video game input Game Port PC. devices. These are some of the different types of computer ports and their examples. Each type of port has its own characteristics and is suitable for different applications and industries. Activity: 1. Explain the role of the I/O sub-system in transferring data between a computer system and external devices. 2. What types of events can lead to incompatibility issues with USB peripherals? 3. How does the quality of a USB cable impact the data transfer rate and throughput? 4. Create a flowchart illustrating the process of data transfer using Direct Memory Access (DMA).