Communication tips and tricks
Connecting an old HP computer to a PC
The problem we had was: we had to connect an old HP computer to a PC.
We could not modify the software on the HP computer.
Our solution was: We wrote a software on the PC that emulated a HPIB
(GPIB) printer and connected the PC as the HPIB printer to the old HP computer, we then gave the print command on the HP that sent the data,
on the PC, the software acted as a GPIB device, received the data and wrote it to a file.
RS-xxx protocols, what's the difference
There are several serial protocols, what does each one means?
First of all, the letters RS stand for 'Recommended Standard' that is why this is not a real standard and many vendors have different versions for each protocol.
RS-232 - Asynchronous serial protocol with voltage levels on single pin for transmit and receive, -7V to -12V is logic '1' and +7V to +12V is
RS-422 - Asynchronous serial protocol with differential lines for transmit or receive, voltage levels are 0 and 5V for logic '0' and '1' respectively.
There are two lines for transmit and two lines for receive the actual level is the difference between the two lines.
RS-485 - Asynchronous serial protocol with current levels instead of voltage levels.
This protocol can be used with long communication lines, about several hundred meters.
This protocol is usually used for connecting more than one instrument on the line although from hardware level there is no support for multiple instruments. Multiple instrument support is done by software, however there is no standard that governs how this should be done.
Finding the Tx pin on RS-232 connector
On RS-232 connectors, either pin 2 or pin 3 is the transmit pin, if you don't have the documentation, how do you know which of them is the transmit?
Connect a DVM between pin 2 or pin 3 to ground (pin 5 on 9 pin connector, pin 7 on 25 pin connector) The voltage on the transmit pin will be about -10V.
Personal computer RS-232 pin out
Most Personal Computers (PC's) have 9 pin RS-232 connector, some of them have 25 pin connector.
The following tables shows the main lines on each connector:
|DB-25 connector||DB-9 connector|
|2 - Tx||2 - Rx|
|3 - Rx||3 - Tx|
|4 - RTS||5 - GND|
|5 - CTS||7 - RTS|
|7 - GND||8 - CTS|