Reader Comments

RS232 Uses Inverse Logic; that Is

by Lydia Matthaei (2024-07-02)


A jumper labeled "2 485En" (J7) enables RS485 operation on the Serial2 port if the jumper cap is installed, and configures Serial2 for RS232 operation if the jumper cap is not installed. A jumper labeled "1 485En" (J4) enables RS485 operation on the Serial1 port if the jumper cap is installed, and configures Serial1 for RS232 operation if the jumper cap is not installed. 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. Finally, for master devices, the SPR1 and SPR0 bits determine the baud rate at which data is exchanged. Because we chose the default baud rate (which the terminal is presumably already set for), you can simply move the serial cable from the Serial Port 1 connector to the Serial Port 2 connector on the Docking Panel to complete the change to the new port.



The advantage of using Serial1 for RS485 is that the Serial1 RS485 signals are also available on the Docking Panel, while the Serial2 RS485 signals are available only on the PDQ Board’s Serial Communications Header. Two devices are at the ends of the cable, while others are connected somewhere in between. Since both channels can operate simultaneously and independently, debugging can be performed while the application program is communicating via its primary channel. Data translation between different machines can be performed with ease, and applications that communicate via the one serial port can be debugged using the other serial channel. In either of these cases, a source of noise that caused one bit to be received incorrectly would invalidate the received byte, since the total number of '1' bits would be odd rather than even. If your application requires communicating with a device that expects to receive a parity bit, the generation of a parity bit and selection of even or odd parity, and whether there are seven or eight data bits in each byte, is performed by setting or clearing bits in the configuration registers SCI0CR1 for Serial1 and SCI1CR1 for Serial2.



The end devices are responsible for terminating the cable so that there are no reflections from the cable ends. Ideally, the two ends of the cable will have a termination resistor connected across the two wires. Resistive termination - If the PDQ Board is at the end of the RS485 cable you can terminate the cable by installing jumper caps at both jumper locations, "Term" and "RTerm". Once the project is open, click Build→ Build, and after the compilation is done, enter the Mosaic Terminal by clicking Tools→ Mosaic Terminal and use the Send File menu item to send GETSTART.DLF to the PDQ Board. The terminal program communicates with the PDQ Board via this serial port. No termination - If the PDQ Board is not an end device, you should not terminate that cable. They should generally not be needed, except if you use long cables, multiple RS485 devices, and resistive termination. The value of each termination resistor should be equal to the cable characteristic impedance (typically, 120 ohms for twisted pairs). RS485 multi-drop networks are daisy-chained networks with a single cable connecting multiple devices. By using repeaters very large RS-485 networks can be formed. RS-485 is used as the physical layer underlying many standard and proprietary automation protocols used to implement industrial control systems, including the most common versions of Modbus and Profibus.



The RS-485 application in heating, ventilation, air-conditioning unit. A current transformer suitable for the application must therefore be selected. Pre-coded device drivers configure the SPI for a standard data format, and it is easy to customize a data format and baud rate for your application. The default baud rate for both Serial1 and Serial2 is 115200 baud after a factory cleanup. If this limitation is not a problem, you can reverse the roles of the Serial1 and Serial2 ports, because they have identical communications capabilities. Routines that temporarily disable interrupts for significant periods of time can also interfere with the Serial2 port. Typing a carriage return at the terminal should now produce the familiar ok response via the Serial2 port. Typing a carriage return at the terminal should now produce the familiar "ok" response via the Serial2 port. For Serial2 RS232 operation: Remove the jumper shunt from "2 485En" (J7). For Serial1 RS232 operation: Remove the jumper shunt from "1 485En" (J4). For Serial1 RS485 operation: Install the jumper shunt onto "1 485En" (J4). For Serial2 RS485 operation: Install the jumper shunt onto "2 485En" (J7). In this case, cable connections may be made to Serial 2 on either the 10-pin PDQ Board Serial Communications Header, or the Docking Panel’s 10-pin right-angle Serial Header, or the Docking Panel’s Serial2 DB-9 Connector.

RS485 Communication Using MAX485 and MSP430 Launchpad - jpralves.net