Because all of the serial I/O routines on the PDQ Board are revectorable, it is very easy to change the serial port in use without modifying any high level code. We can gain insight into the operation of the RS232 protocol by examining the signal connections used for the primary serial port in Table 9 6. The transmit and receive data signals carry the messages being communicated between the QScreen Controller and the PC or terminal. In this case, cable connections may be made to Serial 2 at pins 4 and 10 of the PDQ Board’s 10-pin Serial Header, or pins 5 and 6 of the Docking Panel’s 10-pin right-angle Serial Header. Circuits may be terminated on screw terminals, D-subminiature connectors, or other types of connectors. Most computers conform to IBM PC AT-compatible RS232 interfaces which use 9-pin D-Type connectors, consequently the PDQ Board brings out its serial ports to two female 9-pin D-Type connectors on the Docking Panel. Although the RS232 protocol specifies functions for as many as 25 pins, each communications channel requires only three for simple serial interfaces: TxD1 (transmit data), RxD1 (receive data), and DGND (digital ground).
The words port and channel are used interchangeably to refer to a serial communications link. Data translation between different machines can be performed with ease, and applications that communicate via the primary serial port can be debugged using the secondary channel. In fact, the program works the same as it did before, but now it is using the secondary serial port instead of the primary port - and you didn’t even have to recompile the code! In order to avoid errors when many devices are connected, cables of the same colour should be used for all the connections to the terminals A and cables of the same colour should be used for all the connections to the terminals B of the various devices (e.g. white for A and blue for B). By default, the RS485 connections are not brought out to the Docking Panel’s DB-9 Serial1 Connector, although custom placement of zero-ohm surface-mount resistors on the Docking Panel can route the RS485 signals to the DB-9. Under some conditions it can be used up to data transmission speeds of 64 Mbit/s.
To use a QScreen as a slave in a multi-drop network, simply define a word, (named Silence(void), for example) that when executed calls RS485Receive() to wait for any pending character transmission to complete, then disable the transmitter, and then execute a routine such as Key() to listen to the communications on the serial bus. The Silence() routine searches the incoming serial characters for a pre-determined keyword (for example, the ascii name of this particular slave). The master and slave could even exchange ascii QED-Forth operating system commands. The two values provide a sufficient margin for a reliable data transmission even under severe signal degradation across the cable and connectors. Interoperability of even similar devices from different manufacturers is not assured by compliance with the signal levels alone. The standard does not discuss cable shielding but makes some recommendations on preferred methods of interconnecting the signal reference common and equipment case grounds.
PC environment. 8P8C modular connectors are used in this case. The RS485 system used for Modbus communication provides a main cable (Bus or backbone), to which all the devices have to be connected with branches (also known as stubs) that are as short as possible. This robustness is the main reason why RS-485 is well suited for long-distance networking in noisy environment. The diagram below shows potentials of the A (blue) and B (red) pins of an RS-485 line during transmission of one byte (0xD3, least significant bit first) of data using an asynchronous start-stop method. Care must be taken when using A/B naming. Care must be taken that an SC connection, especially over long cable runs, does not result in an attempt to connect disparate grounds together - it is wise to add some current limiting to the SC connection. Failure to stay within this range will result in, at best, signal corruption, and, at worst, damage to connected devices. RS232 uses inverse logic; that is, rs485 cable a positive bit at the 68HC11 UART is inverted by the onboard RS232 driver chip and appears as a negative signal on the serial cable.