This article tells you just about everything you need to know to get a RS232 connection working between your computer and your measuring device or instrument. It starts by discussing the RS232 standard and continues with the various pin connections available.
Feb 19, 2010 - The modules will replace (pin-for-pin) a male or female DB9 RS232 connector with a USB. Figure 1.2 – DB9-USB-RS232 Block Diagram. This connector provides the interface for connection to a USB Host or Hub port. Adds one USB serial port by connecting to the RS232 DB9 footprint of a device.
The next section gives a step-by-step guide to getting communications working: testing the different elements of the system. Finally there are suggestions for further reading and you are invited to send us your comments or questions. RS stands for recommended standard. In the 60's a standards committee now known as the Electronic Industries Association developed an interface to connect computer terminals to modems. Over the years this has been updated: the most commonly used version of the standard is RS232C (sometimes known as EIA232); the most recent is RS232E. The standard defines the electrical and mechanical characteristics of the connection - including the function of the signals and handshake pins, the voltage levels and maximum bit rate.
If RS232 is a standard why can't I just use a standard lead to connect together two RS232 ports and expect them to talk to one another? That's a good question. The answer is that the RS232 standard was created for just one specific situation and the difficulties come when it is used for something else. The standard was defined to connect computers to modems. Any other use is outside of the standard. The authors of the standard had in mind the situation below: The standard defines how computers (it calls them Data Terminal Equipment or DTEs) connect to modems (it calls them Data Communication Equipment or DCEs). The standard says that computers should be fitted with a 25 way plug whilst modems should have a 25 way D socket.
The interconnecting lead between a computer and a modem should be simply pin1-pin1, pin2-pin2, etc. The main signals and their direction of flow are described below. It is important to note that a signal which is an output from a computer is an input to a modem and vice versa. This means that you can never tell from the signal name alone whether it is an input or an output from a particular piece of equipment. Also, instead of being a DCE device, a data acquisition device might be configured as DTE. In this case you need an adaptor or the RS232 cable wired differently to normal.
When the PC is connected to a DTE instrument - called a null modem arrangement - some of the cable wires must cross over. RS232 Pin Connections TXD Transmitted Data, Pin 2 of 25 way D This is the serial encoded data sent from a computer to a device. RXD Received Data, Pin 3 of 25 way D This is the serial encoded data received by a computer from a device.
DSR Data Set Ready, Pin 6 of 25 way D This should be set true by a device whenever it is powered on. It can be read by the computer to determine that the device is on line. DTR Data Terminal Ready, Pin 20 of 25 way D This should be set true by a computer whenever it is powered on.
It can be read by the device to determine that the computer is on line. RTS Request to Send, Pin 4 of 25 way D This is set true by a computer when it wishes to transmit data. CTS Clear To Send, Pin 5 of 25 Way D This is set true by a device to allow the computer to transmit data. The standard envisaged that when a computer wished to transmit data it would set its RTS. The local modem would then arbitrate with the distant modem for use of the telephone line. If it succeeded it would set CTS and the computer would transmit data. The distant modem would use its CTS to prevent any transmission by the distant computer.
DCD Data Carrier Detect, Pin 8 of 25 Way D This is set true by a modem when it detects the data carrier signal on the telephone line. PC Serial Ports (DTE) A nine pin D plug has become the standard fitting for the serial ports of PCs, although it's nothing to do with the RS232 standard.
Universal Serial Bus (USB) is an interface to establish communication between devices and a host controller (usually personal computer). Nowdays USB has replaced a variety of earlier PC interfaces (such as, and even ). Due to the ability to supply power to the preipheral devices USB is often used as a. An USB system architecture consists of a host controller, a USB ports, and multiple connected devices. Additional USB hubs may be included allowing branching into a tree structure with up to five tier levels. USB can connect computer peripherals such as mice, keyboards, printers, Media Transfer Protocol (MTP) devices, flash drives, Network Adapters, and. For many of those devices, USB has become the standard connection method.
USB interface aimed to remove the need for adding expansion cards into the computer's or bus, and improve plug-and-play capabilities by allowing devices to be hot swapped or added to the system without rebooting the computer. The USB Pinout: Pin Name Cable color Description 1 VCC Red +5 VDC 2 D- White Data - 3 D+ Green Data + 4 GND Black Ground USB connectors There are several types of USB connectors. The connector mounted on the host or device is called the receptacle, and the connector attached to the cable is called the plug. The original USB specification detailed Standard-A and Standard-B plugs and receptacles. Nowdays there are 7 USB connectors known: Standard-A, Standard-B,. And are slightly different: standard USB uses 4 pins while Mini-USB and Micro-USB uses 5 pins in connector. The additional pin is used as an attached device presence indicator.
USB pinout signals USB is a serial bus. It uses 4 shielded wires: two for power (+5v & GND) and two for differential data signals (labelled as D+ and D- in pinout). NRZI (Non Return to Zero Invert) encoding scheme used to send data with a sync field to synchronise the host and receiver clocks. In Data+ and Data- signals are transmitted on a twisted pair. No termination needed.
Half-duplex differential signaling helps to combat the effects of electromagnetic noise on longer lines. Contrary to popular belief, D+ and D- operate together; they are not separate simplex connections. USB 2.0 provides for a maximum cable length of 5 meters for devices running at Hi Speed. USB transfer modes Univeral serial bus supports Control, Interrupt, Bulk and Isochronous transfer modes. USB interfaces specifications.
There are some major USB versions known nowdays: USB 1.0 - Low Speed or Full Speed. released in 1996. Specifies data rates of 1.5 Mbit/s (Low-Bandwidth, is mostly used for Human Input Devices (HID) such as keyboards, mouses, joysticks and often the buttons on higher speed devices such as printers or scanners) and 12 Mbit/s (Full-Bandwidth). nowadays is still used used by some devices that don't need faster data transfer rates. USB 2.0 - High Speed. released in 2000. in addition to USB 1.0 adds signaling rate of 480 Mbit/s (Hi-Speed).
compatible with USB 1.0, but some hardware designed for USB 2.0 may not work with USB 1.0 host controllers. USB 3.0 - SuperSpeed.
released in 2008. added transmission rates up to 5 Gbit/s (SuperSpeed). USB 3.1 released in 2013 added SuperSpeed+ transmission rate up to 10 Gbit/s. USB 3.2 released in 2017 added SuperSpeed+ transmission rate up to 20 Gbit/s and multi-link modes USB 1.0 and USB 2.0 shares same connector pinout, and features new connectors with their own pinouts. An USB device must indicate its speed by pulling either the D+ or D- line high to 3.3 volts. These pull up resistors at the device end will also be used by the host or hub to detect the presence of a device connected to its port. Without a pull up resistor, USB assumes there is nothing connected to the bus.
In order to help user to identify maximum speed of device, a USB device often specifies its speed on its cover with one of the USB special marketing logos. When the new device first plugs in, the host enumerates it and loads the device driver necessary to run it. The loading of the appropriate driver is done using a PID/VID (Product ID/Vendor ID) combination supplied by attached hardware.
The USB host controllers has their own specifications: UHCI (Universal Host Controller Interface), OHCI (Open Host Controller Interface) with USB 1.1, EHCI (Enhanced Host Controller Interface) is used with USB 2.0. USB powered devices The USB connector provides a single 5 volt wire from which connected USB devices may power themselves. A given segment of the bus is specified to deliver up to 500 mA. This is often enough to power several devices, although this budget must be shared among all devices downstream of an unpowered hub. A bus-powered device may use as much of that power as allowed by the port it is plugged into. Bus-powered hubs can continue to distribute the bus provided power to connected devices but the USB specification only allows for a single level of bus-powered devices from a bus-powered hub. This disallows connection of a bus-powered hub to another bus-powered hub.
Many hubs include external power supplies which will power devices connected through them without taking power from the bus. Devices that need more than 500 mA or higher than 5 volts must provide their own power.
When USB devices (including hubs) are first connected they are interrogated by the host controller, which enquires of each their maximum power requirements. However, seems that any load connected to USB port may be treated by operating system as device. The host operating system typically keeps track of the power requirements of the USB network and may warn the computer's operator when a given segment requires more power than is available and may shut down devices in order to keep power consumption within the available resource. USB power usage: Specification Current Voltage Power (max) Low-power device 100 mA 5 V 0.50 W Low-power SuperSpeed (USB 3.0) device 150 mA 5 V 0.75 W High-power device 500 mA 5 V 2.5 W High-power SuperSpeed (USB 3.0) device 900 mA 5 V 4.5 W Battery Charging (BC) 1.2 1.5 A 5 V 7.5 W Type-C 1.5 A 5 V 7.5 W 3 A 5 V 15 W Power Delivery 2.0 Micro-USB 3 A 20 V 60 W Power Delivery 2.0 Type-A/B/C 5 A 20 V 100 W To recognize Battery Charging, a dedicated charging port places a resistance not exceeding 200 Ω across the D+ and D− terminals. Dedicated charger mode: A simple USB charger should incorporate 200 Ohm resistor between D+ and D- wires (sometimes shortcircuit D+ and D- together is enough). The device will then not attempt to transmit or receive data, but can draw up to 1.8A, if the supply can provide it. USB voltage: Supplied voltage by a host or a powered hub ports is between 4.75 V and 5.25 V.
Maximum voltage drop for bus-powered hubs is 0.35 V from its host or hub to the hubs output port. All hubs and functions must be able to send configuration data at 4.4 V, but only low-power functions need to be working at this voltage. Normal operational voltage for functions is minimum 4.75 V. USB cable shielding: Shield should only be connected to Ground at the host. No device should connect Shield to Ground. USB cable wires: Shielded: Data: 28 AWG twisted Power: 28 AWG - 20 AWG non-twisted Non-shielded: Data: 28 AWG non-twisted Power: 28 AWG - 20 AWG non-twisted Power Gauge Max length 28 0.81 m 26 1.31 m 24 2.08 m 22 3.33 m 20 5.00 m.