Hot swapping
From Wikipedia, the free encyclopedia
Hot swapping or hot plugging is the ability to remove and replace components of a machine, usually a computer, while it is operating. Once the appropriate software is installed on the computer, a user can plug and unplug the component without rebooting. A well-known example of this functionality is the Universal Serial Bus (USB) that allows users to add or remove peripheral components such as a mouse, keyboard, or printer. It usually requires more sophisticated software and hardware than does plug-and-play.
Contents |
[edit] History
Historically, only expensive systems could hot-swap components as it was very difficult to engineer correctly. However, the technology has become commonplace in recent years and even low-end computer systems support it.
Protocols that now support hot swapping include PCMCIA, USB, FireWire, Fibre Channel, SATA and SAS. Protocols that do not support hot swapping include PATA. Hot-swap components can include anything from USB flash drives to server hard drives, or PCI-X expansion cards (PCI-X usually only in servers), PCMCIA cards (PC Cards) used in laptops, and even some power supplies.
[edit] System considerations
Machines that support hot swapping need some ability to detect that a component has been removed. In addition, all electrical and mechanical connections need to be designed such that neither the component nor the user can be harmed by removing it. Lastly, other components in the system must be designed such that the removal of a different component does not harm operation. Often there is some automatic recovery process.
Some implementations require a component shut-down procedure prior to removal. This simplifies the design, but such devices are not robust in the case of component failure. If a component is removed while it is being used, the operations to that device fail and the user is responsible for retrying if necessary. As this action is normally done by end-users this is not considered a problem. These hot swap operations are generally used either to move a peripheral component from one computer to another, or to allow a device to synchronize data with a computer.
More complex implementations may recommend that the component be shut down, but there is sufficient redundancy in the system such that if a component is removed without being shut down, operation continues. In these systems hot swap is normally used for regular maintenance to the computer, or to replace a broken component.
There are two slightly differing meanings of the term hot swapping. In some contexts, it refers only to the ability to add or remove hardware without powering down the system, while in other contexts, it refers to the system's ability to autonomously detect when hardware is added or removed. In the former case, one can add or remove hardware without powering down, but the system software may have to be notified of the event in order to use the new hardware. Examples of the former include RS-232, FireWire and lower-end SCSI devices, while examples of the latter include USB, FireWire and higher-end SCSI devices. When comparing these two cases, it is common to only refer to the latter case as true hotplugging, and call the former case coldplugging.
[edit] Connectors
Most modern hot-swap methods rely on a specialised connector with staggered pins. At one time staggered pins were thought to be an expensive solution, but many contemporary connector families now come with staggered pins as standard. For example, they are used on all modern serial SCSI disk-drives. Specialised hot-plug power connector pins are now commercially available with repeatable DC current interruption ratings of up to 16A. Printed circuit boards can be designed for direct hot-plugging onto a backplane, with staggered edge-fingers providing the same results as staggered connector pins.
Most staggered pin designs have the ground pins longer than all the other pins. This ensures that any sensitive circuitry is never connected before there is a reliable system ground. The rest of the connector might be made up of short pins, or in some cases there can be a total of three different pin-lengths.
Although the speed of plugging cannot be controlled precisely, practical considerations will provide limits that can be used to determine worst-case conditions. For a typical staggered pin design where the length difference is 0.5 mm (0.020 inches), the elapsed time between long and short pin contact is between 25 ms and 250 ms. It is quite practical to design hot-swap circuits that can operate over that dynamic range. Note that pins of the same nominal length do not make contact at exactly the same time due to mechanical tolerances.
As long as the hot-swap connector is sufficiently rigid, one of the four corners will always be first to make physical contact with the slot. For a typical two-row connector arrangement this provides four first-to-make corner pins that are usually used for grounds. Other pins near the corners can be used for functions that would also benefit from this effect, for example sensing when the connector is fully seated. This diagram illustrates good practice where the grounds are in the corners and the power pins are near the centre. Two sense pins are located in opposite corners so that fully seated detection is confirmed only when both of them are in contact with the slot. The remaining pins are used for all the other data signals.
[edit] Power electronics
The DC power supplies to a hot-swap component are usually pre-charged by dedicated long pins that make contact before the main power pins. These pre-charge pins are protected by a circuit that limits the inrush current to an acceptable value that cannot damage the pins nor disturb the supply voltage to adjacent slots. The pre-charge circuit might be a simple series resistor, a Negative Temperature Coefficient (NTC) resistor, or a current-limiter circuit. Further protection can be provided by a "soft-start" circuit that provides a managed ramp-up of the internal DC supply voltages within the component.
A typical sequence for a hot-swap component being plugged into a slot could be as follows:
- Long ground pins make contact - Basic electrical safety and ESD protection becomes available
- Long (or medium) pre-charge pins make contact - Decoupling capacitors start to charge up
- Realtime delay of tens of milliseconds
- Short power/signal pins make contact
- Connector becomes fully seated - Power-on reset signal asserted within component
- Soft-start circuit starts to apply power to the component
- Realtime delay of tens of milliseconds
- Soft-start circuit completes sequence - Power-on reset circuit deasserted
- Component begins normal operation
Hot-swap power circuits can now be purchased commercially in specially designed ASICs called Hot Swap Power Managers (HSPMs).
[edit] Signal electronics
Circuitry attached to signal pins in a hot-swap component should include some protection against ElectroStatic Discharge (ESD). This usually takes the form of clamp diodes to ground and to the DC power supply voltage. ESD effects can be reduced by careful design of the mechanical package around the hot-swap component, perhaps by coating it with a thin film of conductive material.
Particular care must be taken when designing systems with bussed signals which are wired to more than one hot-swap component. When a hot-swap component is inserted its input and output signal pins will represent a temporary short-circuit to ground. This can cause unwanted ground-level pulses on the signals which can disturb the operation of other hot-swap components in the system. This was a problem for early parallel SCSI disk-drives. One common design solution is to protect bussed signal pins with series diodes or resistors. CMOS buffer devices are now available with specialised inputs and outputs that minimise disturbance of bussed signals during the hot-swap operation. If all else fails, another solution is to quiesce the operation of all components during the hot-swap operation.
[edit] Software
Hot swapping can also refer to the ability to alter the running code of a program without having to interrupt its execution, although only a few languages support it. Those that do include Lisp, Erlang, and Smalltalk. The Java programming language also supports this technology, but only through the Java Platform Debugger Architecture (JPDA) : it is only possible to change the code while the program is in the control of a Debugger. Interactive programming is a paradigm that makes extensive use of hot swapping so that the programming activity becomes part of the program flow itself.