You are on page 1of 8

Devices Powered From RS232 Lines

by Analog Services, Inc.


Introduction Although several new peripheral interfacing schemes such as Universal Serial Bus threaten to do away with RS232, it still remains a workhorse. The really good thing about RS232 [1] is that it was devised long ago when a signal had to be pretty hefty to reliably detect it. Early computers used +12 volt and -12 volt supplies to generate the RS232. It was not uncommon for an RS232 driver to provide 10 volt at 3 or 4 mA. Later, semiconductor vendors began offering RS232 drivers that ran from the +5 volt or +3 volt supply and contained on-board converters to increase voltage. These new chips were designed to run lean; meeting but not grossly exceeding the RS232 spec. Still, any device that meets RS232 and drives a cable capacitance has to be able to supply some power. This, along with steadily declining power needs for most analog and digital functions, means that entire devices can often be powered from RS232 lines. You've probably already used one in the form of a serial port mouse. There are many factors to consider when designing the RS232-powered device. Most such devices have some data communication function, which means that output lines may have to double as power and communication lines. The device may also need protection against transmit lines that are not yet initialized or inadvertently become set to the wrong state. Advantage can sometimes be taken of the fact that the TXD (transmit) driver data must contain start and stop bits, which are known, recurring states. The device may have to drive some input lines. Inputs at the extremes of the RS232 specification are a heavy load and can present a problem. However, advantage can often be taken of the fact that modern RS232 receiver designs don't need nearly the prescribed RS232 signal swing. Finally, there exist "RS232 driver" designs that try to stretch things by using supply rails of -5 volt and +5 volt. These are not true RS232 interfaces and can create problems if your device is expected to work with them. In this note we discuss these and other aspects of RS232-powered devices. You will probably notice that this discussion is slanted toward the RS232 interface as implemented in "IBM-compatible" personal computers. We hope that it is useful for other RS232 implementations as well. Another slant is toward situations where current and voltage are used "as is" directly from RS232 drivers, with no batteries used to store energy and no DCDC converter used to change voltage or current levels. The Signals The RS232 signals are listed in the following table. The 3 listed as outputs are the ones capable of supplying power.

Pin (9-pin D-sub) 1 2 3 4 5 6 7 8 9

Pin (25-pin D-sub) 8 3 2 20 7 6 4 5 22

Symbol DCD RXD TXD DTR GND DSR RTS CTS RI

Name Data Carrier Detect Receive Data Transmit Data Data Terminal Ready Signal Ground Data Set Ready Request to Send Clear to Send Ring Indicator

Input or Output Input Input Output Output Input Output Input Input

Asserted High Low Low High High High High High

(The assumption here is that this is a DTE (Data Terminal Equipment) interface. In a DCE (Data Communication Interface) the inputs and outputs are reversed.) TXD idles in a High state. A start bit is negative-going.

RS232 Electrical Specs The requirements for a driver (output) and receiver (input) are simple and are essentially DC requirements: 1. 2. A receiver may present a load ranging from 3000 ohm to 7000 ohm and expects signals to swing from below -3 volt to above +3 volt. A driver must have an output resistance of at least 300 ohm and present a swing of below -5 volt to above +5 volt to a receiver. Open circuit driver voltage range is as high as -25 volt to +25 volt, but must drop to + and -15 volt with receiver load.

Most receiver chips are designed to switch in the range of 0.5 volt to 2 volt. (This is within the RS232 spec.) It would be great if all of them were, since then we could cut corners and drive them from circuits that swing only down to ground. Unfortunately, you may find a receiver that must be driven below ground. In our work, the 4th serial port board we tested used a receiver design based on the 75174. It needed a voltage swing down to -1 volt. Later, we'll show you how we did it. What about Noise Margin? If RS232 says to drive receivers to + and -3 volt, then don't we have to do this? Assuming that the device being powered has little or no cable between it and the RS232 port, it isn't likely to pick up much noise. That lets us get by with driving the RS232 receivers just a little past their switching thresholds. The receiver resistance is typically 5 kohm, which is the center of the specification. However, semiconductor manufacturers specify that current can be as high as 1 mA with 3 volt applied (or as low as -1 mA with -3 volt applied). In other words, they're saying that the

resistance could be as low as 3000 ohm. To be safe, we should assume that it can be this low, even though there will probably always be a guardband that keeps it somewhat higher. The open circuit driver voltage of 25 volt looks scary. But we have never found any RS232 implementations that used supply rails of greater than 12 volt and are comfortable using circuitry that is rated for 12 volt maximum. The open-circuit voltage is usually only a problem in the sense that, if suddenly applied to your circuit, it could cause something to break down and cease to function. Usually, once your circuit is operating normally and drawing current from an RS232 line, the problem becomes one of not enough voltage. The requirement that driver output be no more than + and -15 volt with 7000 ohm load probably means that there are no RS232 implementations with supply rails outside of + and -15 volt. If you absolutely must have a 15 volt capability, you could either choose components that are rated for 15 volt or else put back-to-back zener diodes on the 3 driver lines (in your device). The 300 ohm (or more) of output resistance will have to absorb the power due to the voltage difference. So don't clamp at too low a voltage. Seven volt is probably OK. If a driver with output resistance of at least 300 ohm must apply at least 5 volt to a receiver with resistance as low as 3000 ohm, the open circuit driver voltage must be at least 5.5 volt. This makes it impossible, without an on-board DC-DC converter, to create a true RS232 implementation with only a 5 volt supply rail. We have come across psuedo-RS232 driver designs using + and -5 volt rails (probably to get by with fewer power supplies). This seems to be used primarily in programmable logic controllers (PLCs) that are used in industrial control. No doubt they do the job they were intended to, because RS232 is so conservative. But they can cause problems at the RS232 limits. If your device must work with one of these, you should get one and test it to see what kind of power you will be able to draw from it. A more recent standard, RS-562 [4], is very similar to RS-232, except that it requires an output of only 3.7 volt across 3 kohm. Since this can be done with + and -5 volt rails, it seems like an attempt to accommodate the psuedo-RS-232 drivers. With the newer chips available (with on-board charge-pump converters) there doesn't seem to be any reason, except maybe slightly lower power, for not going with a true RS-232 interface. But out there somewhere there probably lurks an RS-562 serial port. Your device may have to satisfy both RS-232 and RS-562. The RS232 specifications suggest a minimum drive capability of 5 volt across 3000 ohm or 5 volt at 1.67 mA. However, to provide some margin and ability to drive a large capacitance, even the lean RS-232 drivers that run on 3.3 volt can typically do better than this. The next section will show this.

Measurement of Driver Capability Measurements were made on several samples of a low voltage RS232 chip. (Obviously, it wouldn't be very helpful to test an old style driver like a 1488.) The chip selected is the National Semiconductor DS14C335. It runs on 3.3 volt supply and is believed representative of most parts of this type. Two measurements were made that were consistent with a project that we were doing at the time. Only the ability to drive high (+ voltage) was measured. The measurements are:

1. 2.

Output voltage with load current = 2 mA. Load current required to drag the voltage down to 5.00 volt.

During the measurements the supply voltage was kept within the range of 3.30 volt to 3.36 volt. The results are shown in the following graph (Figure 1).

Figure 1 -- Measured Voltage - Current Relationship of RS232 Chip This data suggest that we can probably get 2 mA at 6 volt or 3.5 mA at 5 volt from this device. Dealing With Pre-Initiation Output Level Software is usually required to initialize the RS232 outputs to the correct (High or Low) state. Until this is done a given output can be in either state. An output can also be inadvertently switched to the wrong state. If the output is directly connected to the power pins of circuits in your device, then either the RS232 driver or your device might be harmed. (The RS232 drivers will probably survive because most of them have built-in current limiting.) Even if there is no risk to your device, there may be a problem that the affected RS232 output cannot be sensed correctly by another device. The reason is that your circuitry will usually

clamp the output to one diode drop away from ground. This is an undefined state for an RS232 receiver. One way of dealing with this is to put a diode ahead of the power bus in your device. This fixes the problem. But it also robs you of available voltage (and power). The circuit of figure 2 illustrates how to draw + power from the DTR line without the diode drop. The p-channel MOSFET is ON when DTR is High and OFF when DTR is Low.

Figure 2 -- Method of Drawing Power from DTR Line An n-channel MOSFET would be used to create a - supply. The MOSFETs should be lowthreshold types so that they are turned fully ON with gate-source voltage of about 5 (or -5) volt. Example Driving 2 Inputs The RS232 outputs from which you draw power may be routed to RS232 inputs on another port, so that the outputs have a double load. Or, as in this example, your device may draw power from the outputs while it drives one or more inputs of the same port. As indicated earlier, RS232 inputs may often be the largest loads. An example is given here of a burst-mode type of modem that must drive 2 inputs: RXD and DCD. It shows that, with careful attention to what the RS-232 inputs and outputs are doing at any given moment, a way of managing the available power can sometimes be found. It also illustrates how the recurring start bit in the TXD waveform is used to advantage. The receive thresholds in this case were -1 volt and +2 volt. The device has three states: transmit, receive, and idle. The idle state is essentially the same as the receive state, with the device waiting to receive something. In the transmit state, RTS is High, RXD is High, DCD is Low, and TXD is toggling. In receive, RTS is Low, TXD is High, DCD is High, and RXD is toggling. In idle, RTS is Low, TXD is High, DCD is Low, and RXD is High. DTR is left High at all times as a source of + power. These conditions are summarized in the following table.

Idle Receive Transmit

DTR (Output) RTS (Output) TXD (Output) DCD (Input) RXD (Input) High Low High Low High High Low High High Toggling High High Toggle Low High

During idle DCD must be driven Low and RXD must be driven High. The current drawn from the (High) DTR line is more than enough to power the device and keep RXD High. Similarly, the current drawn from the (Low) RTS line is more than enough to drive DCD Low. During receive the DCD input must be driven High and RXD toggles. Again because DTR is High and RTS is Low, we have enough drive current available to handle the High DCD level and either a High or Low level on RXD. During transmit we face a dilemma because both DTR and RTS are High and we need to drive DCD Low. One possible way of dealing with this is to use a charge-pump converter to generate a negative supply from DTR and RTS. However, a simpler method was found by recognizing that TXD will have a Low-going start bit pulse once each character. In our particular case, this meant that TXD would be Low at least 10 % of the time. The DCD input requires (-1 volt)/3000 ohm = -0.33 mA. If we can draw -3.3 mA from TXD during each start bit pulse (and store the charge on a capacitor), this is sufficient to be able to hold DCD Low. The data of figure 1 show that we should be able to draw -3.3 mA from the TXD line at a voltage of at least -3 or -4 volt. This assumes that the chip is relatively symmetric and able to drive negatively with roughly a similar voltage-current relationship to the one that was measured. (The data sheet for the device suggests that this is true.) The circuit and associated waveforms are illustrated in figure 3. A diode was used in this case, instead of the MOSFET technique of figure 2. The resulting negative supply voltage was found to be more than sufficient.

Figure 3 -- Using TXD Start Pulse to Generate Negative Supply

Level Shifting A typical RS232-powered device will contain a primary circuit block that uses supply rails of +4 volt to +5 volt and ground. If any of the RS232 signals are inputs or outputs to the primary

block, then level shifting is required because these signals swing below ground. An RS232 output signal is easily sensed using a resistive divider and a comparator. The comparator uses the same supply rails as the primary block. An RS232 input signal that must swing below ground is not as easy. A negative supply is needed. Figure 4 shows a technique using part of a CD4007 transistor array.

Figure 4 -- Level Shift Circuit Using CD4007 (numbers are IC pins) The level shifter circuit uses up about 2/3 of an array. The circuit was developed for 1200 bits/second data and may not be fast enough for higher data rates. Speaking of the CD4007, this has got to be one of the most useful ICs ever created. We use it everywhere. It is an array of 3 p-MOS and 3 n-MOS transistors that are somewhat arranged as CMOS pairs. Supply voltage can range from 3 volt to 15 volt. The part is dirt cheap and is useful in some analog as well as digital applications. It was recently featured in an Electronic Design article by Bob Pease [5]. There once was an analog version of the CD4007 called a CA3600. It was characterized as an analog part and was available from RCA/GE/Harris. We suspect that the CA3600 is actually a CD4007 in disguise and that the CA3600 characterization fits the CD4007. Does anyone know?

ReCycle the Current A well-known technique among those who live with miniscule power is to use the current twice: Put two loads in series, with shunt voltage regulators if necessary, and run the same current through both of them. This is suited to high-voltage, low-current situations. The data of figure 1 suggest that two series 3-volt supplies at 2 mA could be created from a single RS232 output. Breakout Boxes

A breakout box connects to an RS232 port and tells you what state (High or Low) each line is in. This is a great tool, provided that it doesn't also draw power from the port. Unfortunately, some do. Your may need to explain (in the product manual) that breakout boxes should not be used with your device. References 1. EIA Standard RS-232, Interface Between Data Terminal Equipment and Data Communication Equipment Employing Serial Binary Data Interchange, EIA, 2500 Wilson Blvd, Arlington, VA 22201-3834. 2. T. Engdahl, "How to get power from RS-232 port", On the Internet. 3. Wettroth, John, "5V Supply Derives Power from Three-Wire RS-232C Port," EDN Design Ideas Annual, February 15, 1996. 4. EIA Standard RS-562.

5. Pease, Bob, "What's All This CD4007 Stuff, Anyhow?", Electronic Design, April 5, 1999, Penton Media, Inc., 1100 Superior Avenue, Cleveland, OH 44114 USA.

You might also like