Index


PC Interfaces and Controlling Devices

    Serial port

    Standard PC serial ports come in to versions: 9 pin and 25 pin one. The functions of those both version are exactly the same, only different kind of connectors and different pinout. If you need to convert from one version to other you can do it easily just bu buying a suitable adapter from your local computer shop. PC serial port is nowadays usually used for interfacing your PC to your modem or mouse. Original PC serial port was designed to operate up to 19.2 kbit/s (maximum speed defined in RS-232C standard) but nowadays they can typically go up to 115.2 kbit/s (some special cards can do even faster than that). PC serial port send and receives data in serial format. In serial, asynchronous data transfer the individual bits which comprise each data byte are sent one after the other over a single line. In this context, asynchronous means that the clock information is not included with the transmission, so that frequent re-synchronization using start/stop bits is required. The maximum length specified by RS-232 is only 50 feet (around 15 meters), however much longer lengths are possible with proper shielding on the cable. Generally you can run 9600 bps communication up to 250 feet (80 meters) over shielded data cable or unshielded twisted pair cable in good enviroment. When using shielded cable ans slower data rate longer lengths are possible (up to hundreds of meters in good conditions). The processing element in PC serial port is UART. UART is an integrated circuit used for serial communications, containing a transmitter (parallel-to-serial converter) and a receiver (serial-to-parallel converter), each clocked separately. The parallel side of a UART is connected to computer bus (usually ISA bus). When the computer writes a byte to the UART's transmit data register (TDR), the UART will start to transmit it on the serial line. The UART's status register contains a flag bit which the computer can read to see if the UART is ready to transmit another byte. Another status register bit says whether the UART has received a byte from the serial line, in which case the computer should read it from the receive data register (RDR). If incorrectly formated data is received the UART may signal a "framing error" or "parity error". The UART may be set up to interrupt the computer when data is received or when ready to transmit more data. Data on the serial line is formatted by the UART according to the setting of the UART's control register. Those registers control the baud rate, number of data bits, number of stop bits and what kind of parity is used (odd, even or none).The original UART chip shipped with the IBM personal computer was the 8250. This chip was limited to 9600 bps maximum rate. It was replaced with the 16450 which had the same architecture as the 8250 but has a higher maximum bps specification (115200 bps). Both of the chips only have a one byte FIFO/buffer. The newer 16550 UART contains a 16-byte buffer which helps the computer in the communications and makes faster communication speeds without lost characters possible. A 16-byte FIFO allows up to 16 characters to be received before the computer has to service the interrupt. There are also other UARTs with longer FIFOs. When operating under DOS at speeds below 9600 bps the 16450 should provide satisfactory performance. When operating under any Windows or other multitasking operating system, a 16450 will be limited to about 1200 or 2400 bps reliable communication. 16550 or similar UART will work on multitasking enviroment at high speeds very nicely. Having FIFO in the UART means that the computer need to have interrupts less often, which means less processing power wasted on the serial communications and less likely that data is lost if it takes some time from interrupt request that actual interrupt happens.The UART's serial connections go via separate line driver and line receiver integrated circuits which provide the power and voltages (+12V and -12V) required to drive the serial line and give some protection against noise on the line. If you are purchasing a fast external modem, make sure that the computer's UART can handle the modem's maximum transmission rate. Most modern PC serial cards and built-in serial ports are designed for maximum 115200 bps data rate (please check that you have 16550 or better UART in it). There are also some special serial port card which can handlealso higher data rates (quadruple the clock speed (4X) will allow transmission speeds up to 460,800 bps and a card with 8X setting will allow speeds up to 921,400 bps).

      Programming

      • C function turns PC into serial-bus master - UARTs built into most microcontrollers support a "9th-bit" communications mode, this function adds this capability to your PC serial port    Rate this link
      • Implement a nine-data-bit UART on a PC - many microcontrollers , such as the 8051 and the 68HC11, can support a ninth data bit on the asynchronous serial port, UART used in IBM PCs (and clones) does not directly support this operating mode however through some software manipulation, you can add the PC to a serial bus and integrate it into a ninth-bit system    Rate this link
      • Interfacing the Serial / RS-232 Port - specs, UART pinouts, registers, example software    Rate this link
      • Laser Transceiver Communicator - This document includes a sample code listing in Borland C++ 3.1 that can be used for full-duplex communication between two computers.    Rate this link
      • Linux Serial Programming HOWTO - This document describes how to program communications with devices over a serial port on a Linux box.    Rate this link
      • Serial Communications in Win32 - Serial communications in Microsoft? Win32? is significantly different from serial communications in 16-bit Microsoft Windows?. Those familiar with 16-bit serial communications functions will have to relearn many parts of the system to program serial communications properly. This article will help to accomplish this. Those unfamiliar with serial communications will find this article a helpful foundation for development efforts. This article assumes the reader is familiar with the fundamentals of multiple threading and synchronization in Win32.    Rate this link
      • Serial Port Central - A collection of files and links to material relating to serial links and networks, especially in monitoring and control applications. This page gives information and communications tools can simplify serial-port programming on PCs.    Rate this link
      • STP100 Servo Control Manual - This manual has information how to use RS-232 / RS-485 ports with Qbasic.    Rate this link

      Software

      • COM Port Toolkit - COM Port Toolkit is an integrated serial communications testing toolkit. It sends user's data to and receives one from a device and records all transfers to a log. You can test equipment.s serial communications protocol by hand: feed it input, check the output. COM Port Toolkit can capture serial communications between the device and the software by using special serial port driver. So COM Port Toolkit acts as a software protocol analyzer in this mode. COM Port Toolkit works on Windows 95, Windows 98, Windows Me, Windows NT 4.0, Windows 2000/XP operating systems. COM Port Toolkit is available for FREE downloading and using for trial period.    Rate this link
      • Electronics projects for PC serial port    Rate this link
      • SIMPLETERM: SIMPle TERMinal Emulator Shareware - a simple shareware tool that can be used to troubleshoot RS-232, RS422 or RS-485 serial communications, runs on DOS, also supports monitor mode which allows SIMPTERM to monitor communications between two other devices    Rate this link

    General

    Universal Serial Bus (USB)

    The USB is a serial data-transmission system that uses cables to connect peripheral equipment to PCs. All new computers have two or more USB receptacles, and the predictions are that they will replace most of the legacy receptacles on older PCs. The Universal Serial Bus (USB) was born out of the frustration PC users experience trying to connect an incredibly diverse range of peripherals to their computers. It's the child of vendors whose laptops require a small profile peripheral connector. It further promises to reduce the proliferation of cables and wall transformers that overwhelm even the smallest computer installation.

    Universal Serial Bus came into life when a group of 7 companies : Compaq, Digital Equipment, IBM, Intel, Microsoft and Northern Telecom decides to form a specifications to merge legacy connectivity such as RS232, Printer port, PS2 port into a single common connector to the Personal Computer. The result : Version 1.0 of the USB specifications delivered on 15 January 1996. Version 1.0 specifies 2 forms of signaling transfer rate : Low Speed (1.5Mbits/sec) and the Full Speed (12Mbits/sec). The motivation of differentiating two transfer speed was to maintain the low-cost implementation of computer peripherals such as keyboards and mice, and, still allow higher speeds devices such that printers and scanners to be able to use the same serial bus. USB was agreed to as a standard by Microsoft, Compaq and many other large names in PC industry. USB 1.0 standard was finally issued in 1996. It was later modified to USB 1.1. Version USB1.1 was delivered on 23 September 1998. The 1.1 specifications clarified many timing parameters which were grey-areas in the past. However, no huge "functional" improvements were given. Like any technology, the start was slow and painful. But after some years it really catched the market. In 27 April 2000, Compaq, Hewlett-Packard, Intel, Lucent, Microsoft, NEC and Philips released version 2.0 of the USB Specifications. While it adds a High Speed physical layer of (480 Mbits/sec), the specifications maintains the Low Speed and Full Speed operation. In effect was a handshake protocol was implemented to negotiate into the different speeds, a new High Speed Hub to manage all 3 speeds and a new Enhanced Host Controller to managed the faster bus and new PIDs to efficiently handle USB bandwidth.

    USB is a serial bus standard for interfacing many different kinds peripherals to your PC. It is aimed to replace most of the different kind of special systems of interfacing external devices to serial and parallel port. Most of the new PCs or motherboard have had USB connectors for some time, but the system has not catched mass markests yet because of lack of drivers (Windows 98 has those). USB can power to the devices connected to it. USB can provide plug and play with hot swapping capabilities. USB provides 12 Mbit/s and 1.5 Mbit/s data transmission speeds. USB 2.0 promises even faster speeds up to 480 Mbps. USB 2.0 is backwards compatible so no USB device is rendered out-of-date. A critical part of the philosophy of USB is that users may connect and remove peripherals without powering the entire system down.

    USB is a serial protocol and physical link, which transmits all data differentially on a single pair of wires. Another pair provides power to downstream peripherals. USB's topology is a "tiered star". Hubs are the communication nodes that interconnect devices. One, and only one, "host" device (typically a PC) includes the "root hub" which forms the nexus for all device connections. USB system is master-slave tybe bus. The PC is the master that supplied power to the bus and controls the bus operation. The peripheral equipment connected to USB bus just follow the PC controlling. Though USB is physically configured as a tiered star, logically (to the application code) a direct connection exists between the host and each device. Two USB peripherals can't communicate with each other directly, there must always be a master PC in the bus. Two PCs can't be directly wired to each other with USB wire, because there can only be one master in the bus (for PC networking using USB there are USB bridge peripherals that can link two PCs together through their USB ports).

    The physical layer were layered with the protocol layer. The protocol layer divides the bus time into several priorities of Control, Interrupt, Bulk and Isochronous transfer. This protocol is handled through a combination of hardware and software on the Personal Computer. The hardware will be the USB Host Controller and the software will most often be Microsoft Windows. The first versio of Windows that supported USB was Microsoft's Windows 95 OSR2.1. USB support became the standard part of Windows 98, and this was the time when the major USB markets started. Later Windows versions have supported USB as well, so USB devices are well supported also on Windows 2000 and XP. Also some non-windows systems support USB hardware. USB support is for example available in new Linux operating system versions. Also new Apple computers have USB ports in them.

    The USB standard specifies two kinds of cables and two variations of connectors. High-speed cables, for 12Mbps communication, are better shielded than their less expensive 1.5Mbps counterparts. Each cable has an "A" connector on one end and a "B" on the other. "A" connectors go to the upstream connection while the "B" version attaches downstream. Since the two types are physically different it's impossible to install a cable incorrectly. The standard USB peripheral cable refers to a cable with an A-male connector and a B-male connector. This cable connects on one end (using the A-male connector) to the host computer or hub and on the other end (using the B-male connector) to the device such as printer, scanner, hub, etc. The A-connector and the B-connector are distinct and do not plug into one another. The A-connector is four pin flat connector and the B-connector is a four pin connector that has almost square form (just two corners rounded). Ready made USB cables are available in a wide variety of length ranging from .5 meters to 5 meters. 5 meters (about 15') is the maximum cable length allowed by the USB specification. USB maximum cable distance is 16 feet. USB hubs cab be used as repeaters when longer distancs are needed (there is a limitation that you can't have more than few USB HUBs in series though).

    USB cable lengths are limited to 5m for 12Mbps connections and 3m for 1.5Mbps. This sounds backwards, but stems from the use of better cables at higher speeds. Five meters is the maximum cable length allowed by the USB specification. You can achieve longer cable runs by inserting a hub every five meters. Alternatively you can chain Active Extension cables to attain the needed distance. If you need longer distances you need to connect many 5 meter segments after each other. Other alternative is to use an "Active Extension Cable", which is basically a 5 meter cable with a built in 1-port hub. You can chain maximum four of these plus a single 5 meter USB peripheral cable to give you the 25 meter maximum reach.

    It may seem like an A-male to A-male cable would be handy to connect two USB hosts together. DO NOT DO THIS! This will short out your computers, possibly causing serious damage. USB was not designed to work this way. USB can't be used directly as a fast connection between PCs, but here are special products which allow small scale networking using USB bus (USB Host to USB Host Adapter). To connect two computers together you will need a USB bridge, a USB Peer to Peer cable for file and hardware sharing or a USB Data Transfer Cable for file sharing.

    In best case USB interface is a very well working plug & play bus if the devices have built-in drivers in the operating system orthe manufacturer gives you good drivers. But for do-it-your self people USB is not the friendliest environment to work with. First the USB itself is quite complicated to implement and second problem are the drivers. For building your own USB peripherals you need to conform to a generic USB driver class, such as Human Input Device class, Mass storage class, etc. or you need to write a WDM driver for yourself - not easy.

    The USB interface uses four pin connector (two different connector forms, known as A and B).?Two pins carry the data (in differential bidirectional bus) and two other pins carry operating power for devices (+5V and ground, current rating 100mA or 500mA depending on device). Though nominally +5V, the spec allows for quite a bit of variation in this; designers should allow for as little as about 4V. A peripheral that draws up to 100 mA can extract all of its power from the bus wiring all of the time. Higher current requirements are trickier; if the device requires less than 500 mS, and if the upstream host or hub can provide that much power (which is optional), the device can be bus-powered if at power-up time, during system configuration, it consumes less than 100 mA. If the device needs more than a half-amp, then it must have its own power supply. USB system has power managing built in. USB hosts and hubs manage power by enabling and disabling power to individual devices to electrically remove ill-behaved peripherals from the system. Further, they can instruct devices to enter the suspend state, which reduces maximum power consumption to 500 microamps (for low-power, 1.5Mbps peripherals) or 2.5 mA for 12Mbps devices.

    The USB specification recognizes two kinds of peripherals: stand-alone (single function units, like a mouse) or compound devices (those that have more than one peripheral sharing a USB port). An example of a compound device is a video camera with separate audio processor. Hubs are bridges; they increase the logical and physical fan-out of the network. A hub has a single upstream connection (that going to the root hub, or the next hub closer to the root), and one to many downstream connections. Hubs are themselves USB devices, and may incorporate some amount of intelligence. Though physically configured as a tiered star, logically (to the application code) a direct connection exists between the host and each device.

    The USB standard defines four data transfer types: control, isochronous, interrupt, and bulk. All USB peripherals must support the control transfer type for configuration, command, and status information. Each of the remaining three data transfer types targets a particular category of USB peripheral. The bulk transfer type targets USB devices such as printers, scanners, and digital cameras that move large amounts of data to or from the PC over USB.

    USB cables utilize two specially designed 4-pin plugs and receptacles. The "upstream" plug is called "A" and the "downstream" plug is called "B". This format is intended to minimize end user termination problems, thereby ensuring proper connectivity. Use the A connector to connect with a host or downstream connection on a hub. Use the B connector to connect to the peripheral appliance. The USB cable consists of one twisted pair for data and two untwisted wires for powering downstream appliances. Specifically, a full-speed cable contains a 28-gauge twisted pair, an untwisted pair of 28 to 20 gauge power conductors, an aluminized polyester shield, a drain wire, and an overall 65% (minimum) copper braid. Nominal impedance for the data pair is 90 ohms. The maximum cable length for USB is a function of signal propagation delay. The cable may have no more than 26 nS delay from connector A to connector B. An additional allowance of 4 nS is split between the sending device connection and the receiver connection/response function, making the entire one-way delay 30 nS maximum. In addition, the cable may not have a velocity of propagation greater than 5.2 nS per meter. The length and twist of the data pair must be matched well enough so that no more than 0.10 nS time skew exists between bit polarities. The nominal differential signal level is 800 mV. The Implementers Forum says that fully compliant USB 1.1 cables will perform at USB 2.0 speeds. The maximum USB cable length according the standard is 5 meters. With the maximum of 5 hubs connected with 5m cables and a 5m cable going to your full speed device, this will give you 30m of cable between your device and PC.

    The 1.0 and 1.1 standards for USB were for 1.5 and 12 Mbps at low- and full-speed rates, respectively. The latest 2.0 standard is for a 480-Mbps rate that will accommodate many high-speed devices along with the previous low- and full-speed rates. The naming of USB has confused since then. Customers were asking what version USB was installed on a machine and if it was USB 1.1 they thought it inferior to USB 2. In December 2002 USB Forum announced that henceforth USB 1.1 would be called USB 2 and USB 2 would continue to be called USB 2. To help the public grasp this subtle distinction USB 2, which was the old USB 1.1, would have ``Full Speed'' added to its title and USB 2, which was USB 2, would have ``Hi-Speed'' added. So nowadays USB 2 could be USB 1.1 or USB 2 depending. This has confised the market and customers. Now www.usb.org says that: ``The correct nomenclature for high-speed USB products is ``Hi-Speed USB.'' The correct nomenclature for low or Full-speed USB products is simply ``USB''. And in the FAQ section it states: ``High speed USB products have a design data rate of 480 Mb/s. Full speed USB devices signal at 12Mb/s.'' On some texts those two different maximum speed USB versions are referred as OHCI and EHCI. OHCI refers to 12 Mbps USB version and EHCI refers to 480Mbps USB version.

      USB device design and driver information

      USB is a complex standard that requires an enormous amount of software support, both on the firmware side and in the host computer. Most host-end connections, for better or worse, will be PCs running a Microsoft operating system. USB is not supported at all in DOS, Windows 3.x, or Windows NT. Windows 95 provided some USB drivers, though only in the later versions starting with OEM Software Release 2.1. All Windows 98 releases include a full set of drivers for common USB applications. Windows 2000 and XP has this same USB support too. A USB driver is a difficult beast. The good news is that in many cases the drivers provided with Windows will handle even your custom peripheral. Windows, as well as the USB specification, segments drivers into "classes," where hardware that falls into a single class shares similar interfaces. A class defines a baseline specification for a given set of capabilities; all devices in a class require comparable types of software support. An example is the human interface device (HID) class, which supports devices like mice, joysticks, and keyboards. Another is the monitor class, which controls image position, size, and alignment on video displays. Custom drivers are an alternative to class drivers. A custom driver exploits the capabilities of a particular piece of hardware at the end of the USB cable. Unless you're building a typically PC-centric peripheral like a mouse, you'll likely also create a host application that exchanges data with the USB device and interacts with the user. To exchange data with the USB device the application code simply issues standard file-like API calls, using a standard Windows handle to identify the device. Since USB is (for all practical purposes) tied to the high-volume PC business, dozens of vendors offer hundreds of different support chips. USB parts are rather hard to categorize, but fall generally into three camps: host-side USB controllers (which live inside the PC, and are probably of little interest to ESP readers), devices designed as stand-alone USB peripheral controllers (like a smart UART, these chips handle communications but you'll need another microprocessor as the brains of your device), and versions of popular processors that include a USB interface. Beyond these three categories, some vendors offer specialized parts, such as USB camera controllers, audio devices, bridges that link USB to other buses, and specialized HID controllers. Development tools are as important as chips and code. USB is a complex protocol that tosses a lot of data around. Debugging by looking at the serial stream on a scope is not efficient. Several companies offer protocol analyzers that monitor the USB link and display transmitted data in an understandable form.The USB sponsoring organization has created a compliance program to ensure that devices meet the standard's specifications. Though no law mandates that any device must pass these tests, doing so ensures that the user's experience with your products will be as trouble-free as possible.

    IEEE 1394 High Performance Serial Bus

    IEEE 1394 is a fast serial bus which is a little bit similar to USB but is capable of much higher speeds (up to 400 Mbit/s). In terms of configuration and how it is used in the PC however, IEEE-1394 can be thought of as "USB, only faster". It is a serial interface that supports dozens of daisy-chained devices, hot-swapping, and plug-and-play. However, instead of USB's 12 Mbits/second maximum transfer rate, IEEE-1394 supports up to 400 Mbits/second.

    The IEEE 1394 standard defines both a backplane physical layer and point-to-point cable-connected virtual bus implementations in terms of media, topology, and protocol. The cable version of the IEEE 1394 standard supports data rates of 100, 200, and 400 Mbps (half duplex operation). The 1394a-2000 standard provided functional enhancements to 1394-1995 to increase 1394 bus throughput at the same data rates. IEEE 1394b specification added 800Mbits/sec speed and full-duplex operation. The typical media used to carry the data signals is two individually shielded 110 ohm twisted pairs (for example 28-30 awg 110 ohm). In addition to that many cables have somewhat thicker wires for carrying power (for example two 22-28 awg lines). he 1394 specification limits cable length to 4.5 meters.

    IEEE 1394 is designed to operate as peer to peer network meaning that there is no different master and slave devices (all IEEE 1394 port are the same). Devices on the bus are Hot-Swappable. The digital interface supports either asynchronous and isochronous data transfers. Addressing is used to a particular device on the bus. Each device determines its own address. IEEE 1394 supports up to 63 devices at a maximum cable distance between devices of 4.5 meters. However, "powered" Firewire devices and repeaters will repeat a signal and allow you to extend another 15 feet. The maximum devices on the bus is 16 allowing a total maximum cable distance of 72 meters. The 1394 specification limits cable length to 4.5 meters in order to satisfy the round trip time maximum required by the arbitration protocol. Some applications may run longer lengths when the data rate is lowered to the 100 Mbps level.

    The 1394 system utilizes two shielded twisted pairs (110 ohms) and two single wires. The twisted pairs handle differential data and strobe (assists in clock regeneration) while the separate wires provide power and ground for remote devices needing power support. Signal level is 265 mV differential into 110 ohms. The 1394 specification provides electrical performance requirements, which leave open the actual parameters of the cable design. As with all differential signaling systems, pair-to-pair data skew is critical (less than 0.40 nanoseconds). Crosstalk must be maintained below -26 dB from 1 to 500 MHz. The only requirement on the size of wire used is that velocity of propagation must not exceed 5.05 nS/meter. The typical cable has 28 gauge copper twisted pairs and 22 gauge wires for power and ground. A Firewire connected appliance may or may not need power from its host, but must be capable of providing limited power for downstream devices.

    The 1394 specification supports two plug configurations: a four-pin version and a six-pin version. Six-pin versions can carry all six connections and are capable of providing power to appliances that need it. For independently powered appliances, like camcorders, the four-pin version is used for its compactness. Cable assemblies have the data signal pairs crossed over to avoid polarity issues. All 1394 type appliances have receptacles, which makes for easy upstream-downstream connection with the male-to-male cable.

    New standard version have increased the avaialble media from original short "Firewire" cable to other medias also. Transmitting data over CAT5 cable allows data at 100Mbps to travel 100m (specified in IEEE 1394b). Fiber cable will allow 100 meter distances at any speed (maximum speed depends on the type of fiber cable).

    IEEE 1394 is nowadays used for interconnecting modern digital video equipments, like for example DV video camera, to a PC. Allows live connection/disconnection. IEEE 1394 was called Firewire before standardization in IEEE. IEEE-1394 is also defined as part of the SCSI-3 family of related standards, and was at one point sometimes called "serial SCSI". In reality, though, IEEE-1394 still has not taken off as a storage interface within the PC. IEEE-1394 does continue to grow in popularity in a variety of specialty markets, especially digital video, where it may well become the next big interfacing standard for consumer electronics devices like camcorders and VCRs. In PC accessories world, the future of IEE 1394 is somewhat uncertain, and the creation of the new, faster USB 2.0 standard continues to keep the waters cloudy. But when we are talking on video applications, IEEE 1394 continues to be the preferred interface over USB.

    IEEE 1395 and Ethernet technologies are converging in some sense. The 1394 Trade Association is working with the IEEE (Institute of Electrical and Electronics Engineers) to develop a combined Ethernet/1394b PHY (physical layer). Once put into silicon, this PHY would live inside a hub that would connect all endpoints in a network regardless of what protocol those endpoints wanted to employ. That is, 1394 devices would think they were on a 1394 network, and Ethernet devices would think they were on a standard Ethernet network. At some point in the network, a bridge would allow Ethernet traffic to cross over to the 1394 "side" and vice versa. Instead of having to worry about differing network technologies, users would see a single RJ-45 wall jack that would simply work with whatever device they chose to plug into it. Inside the walls, an infrastructure of category-5 cable would carry both Ethernet and 1394 traffic. The key to the effort is an autonegotiation protocol that would allow each port to select from various link-layer protocols, including 10- and 100-Mbit/sec Ethernet, 100-Mbit/sec 1394b, Gigabit Ethernet, and 400- or 800-Mbit/sec 1394.

    PC controlling devices

      PC keyboard

      If you're typing on a standard QWERTY keyboard, and most of us are, then your keyboard design is over 100 years old (135 years old). Just about every computer comes factory equipped with a standard flat QWERTY keyboard. New and innovative designs for keyboards have been developed over the past few years. Traditional PC keyboard connects to a PS/2 kayboard interface (6 pin mini DIN connector) on the PC motherboard (some older PCs used 5-pin AT type interface which is electrically practically the same, but just different connector). The keyboard interface actually uses four wires.The IBM keyboard you most probably have sitting in front of you, sends scan codes to your computer. The scan codes tell your Keyboard Bios, what keys you have pressed or released. Besides Scan codes, commands can also be sent to and from the keyboard. PC's keyboard implements a bi-directional protocol. The keyboard can send data to the Host and the Host can send data to the Keyboard. The communication between keyboard and PC moherboard is handled by a special keybaord interface controller IC. Traditional PC motherboard expects that there is a keyboard connected to it when the system boots up. The PC BIOS hardware check routines will check if the keyboard exist, and generally give an error when no keyboard is attached. This generally means that you can't boot a PC normally without a keybord installed to it. If you need to boot up a computer without a keyboard, check your computer BIOS settings. There should be settings in your BIOS set up to skip the keyboard check, this allowing the PC to boot without a keyboard. The PC keyboard interface is designed so the system software has maximum flexibility in defining certain keyboard operations. This is accomplished by having the keyboard return scancodes rather than ASCII codes. Each key generates a 'make' scancode when pressed and a 'break' scancode when released. The computer system interprets the scancodes to determine what operation it is to perform. For historical compatibility reasons computers can employ different sets of scancodes for different purposes. The newest PC keybord products are the ones that connect to USB bus. This does not immediatly replace the traditional PC keyboard, but could be a nice oftopn of extra special keyboard for computer is needed. USB keyboards belong to USB Human Interface Device (HID) class.You may not need any operating system support at all to use a USB keyboard if you have a PC architecture. There are several BIOS available where the BIOS can provide USB support from a keyboard plugged into the root hub on the motherboard. This may or may not work through other hubs and does not normally work with add-in boards, so you might want to add in support anyway.

      PC mouse and other pointing devices

      PC mouse is the most commonly used pointing device for operating graphical user interface (GUI) of the operating system and software running in it. Nowadays there are different techniquest used on mouse to detect themovement and sending that information to computer. For optomechanical designs, a ball makes contact with the desktop surface and rotates two rollers, positioned 90? from each other, as the mouse moves. As each roller moves, it spins a disc with evenly spaced holes along its outer edge. An infrared sensor sees light pulses from the infrared LED on the other side of the disc as the holes pass in front of the sensor. The mouse has two sets of infrared LEDs and sensors for each disc. Counting the pulses and applying acceleration and trajectory heuristics, determines how the mouse movement translates into cursor movement. Optical mouse implementations bounced light off a a surface. Early optical mouse implementations used a special mouse pad thathad a grid of dark lines that interrupted the beam of light when the mouse moved, allowing the software to track the mouse movement. Usually the X and Y direction lines in grid are made with different color, so an optical sensor designed different wavelength can can separate X and Y lines.Contemporary optical mice do not require a mouse pad and can work on almost any surface. Optical mice reflect the light from a red LED and sample it with a CMOS image sensor (as many as 1500 times per second). A special DSP chip performs signal processing on each sample image to detect patterns in the desktop surface and to determine how those patterns have shifted since the mouse took the previous sample. This pattern movements determines the direction and amount of mouse movement.There is wide variety of different PC mouse types. The first mouse productsconnected to PC serial port. The first and nots common serial port mouse types were Microsoft Mouse and Mouse Systems mouse. Both of them used 1200 bps serial communication between mouse and PC, but used different data formats. Those were long the major mouse protocol types (later there were some variations of those with higher data rate and more buttons support, mostly used by Logitech). The next mouse type and most common nowadays is a PS/2 mouse. It was introduced by IBM long time on their IBM PS/2 range of computers. Later other PC manufacturers adopted this mouse port type ot their motherboards. PS/2 mouse uses same type of connector as PS/2 keyboard (6 pin mini-din) and a base data protocol quite similar to PS/2 keyboard (altough different data packets). Modern ATX format PC motherboards have PS/2 mouse port by default, so this is the mouse type you propably got with your new computer. The PS/2 mouse uses the same protocol as the PS/2 (AT) keyboard, but just send different codes than keyboard The standard PS/2 mouse supports the following inputs: X (right/left) movement, Y (up/down) movement, left button, middle button, and right button. The mouse reads these inputs at a regular freqency and updates various counters and flags to reflect movement and button states. There are many PS/2 pointing devices that have additional inputs and may report data differently than the "Basic PS/2 mouse". The latest new series of products are mouse products which conenct to USB bus. Those USB mouse products belong USB Human Interface Device (HID) and use this series of standard drivers (or special drivers supplied by mouse manufacturer). The different pc mouse types in use are incompatible with each other. They use different electrical interfaces and data formats. There are some mouse products on the market which support more than one mouse protocol / interface at the same device. At those case those mouse products are supplied with a connector adapter which adapts the connector model and pinout form one port to another. Those mouse products supplied with the adapters are designed in such way that they work differently depending if the adapter is plugged in or not (so they always work according the interface specification in use). I have seen adapter for example for serial-PS/2 and PS/2-USB interfacing. Those adapters work nicely with the mouse they are supplied with, but they are not interchangeable with any mouse (they work only with "dual mode" mouse which supports both protocol). Those adapters are not suitable for any other use and do not work with any generic mouse. The mouse needs a mouse driver to work (a right driver type for mouse type you use). The mouse driver in the computer received that data packet and decodes the information from it and does actions based on the information. Typically mouse driver has the information of the current mouse state (position and button states) and tells them to the application or operating when it asks them. Typically the mouse drive calls mouse cursor moving routines when mouse is moved and sends messages to the software when buttons are pressed. In typical modern PC mouse driver the actual cursor movement is not linearly related to the mouse movement. This might sound a bit strange but it has been found that there are better ways to change the mouse movement to cursor muvement than just simply causing one mouse step to move the cursor one pixel. During the pioneering research done at Apple Computer in the devellopment of the graphical user interface (GUI), it became apparent that no particular ratio between mouse movement and cursor movement was best suited for all tasks.

      PC joysticks and other game controllers

      From the start of PC era, the most common PC joystick type is PC analogue joystick. This joystick model was presented by IBM together with their first IBM PC computer. The joystick is just a basic analogue joystick with two buttons (many newer joystick have added more buttons and controls though). A basic anlogue PC joystick consists of two potentiometers with variable resistance value between 0 Ohm and 100 kohm plus two buttons wired to right 15 pin joystick connector pins. Most PC soundcards nowadays have this 15 pin joystick interface in them (those soundcards generally have both MIDI and joystick functions on some connector, which causes sometimes problems). Original joystick interface had circuit for connecting two joysticks, but had only one joystick connector. The joystick interface card was designed to be as simple and cheap as possible, which caused that part of the analogue/digital conversion sampling process need to be done with software (in practice a pulse width measurement). This has caused anormous amounts of problems to game programmers when computers have become faster and faster all the time (drivers were need to be updated often earlier). Nowadays analogue joystick drivers work, but have pretty much processor overheard because of the "stupid" design. Traditional PC stering wheels, pedals and gamepads generally use the same interface ideas as the original PC joystick. There have been for quite long time so called "digital joysticks" available for PC joystick interface (which is designed for analogue joysticks).Digital joysticks are all different and use proprietary communicationmethods. They work generally only with Windows (do not work with classic DOS games). The computer can only detect thedigital joystick properly if the correct driver is installed. Driverscan be downloaded free from manufacturer's websites in most cases. Some modern joystick have build to have two operation modes: analog and digital interface. Some digital sticks (like the MS Sidewinder 3D Pro) will work inanalog mode by setting a switch to a certain position, but of coursein this case only the basic functions can be supported (extra buttonsand axes will not work).In analog emulation it emulates the two resistors in a standard joystick. The other mode is all digital where it sends a serial data stream on one of the joystick button inputs, It feeds a clock on another of the button inputs. Those digital signals are then interpreted on some special joystick driver. Some joystick even don't support the traditional analogue interface (just their proprietaty digital communication protocol which their driver understands). The newest joystick type on PC joystick market are the USB joysticks. USB joystics are joysticks which connect to USB bus and use digital communication. USB joysticks belong to USB Human Interface Device (HID) class.


<[email protected]>

Back to ePanorama main page ??