Reader Comments

Enhance Your Rs485 Cable Expertise

by Laurinda Glaser (2024-06-08)


For RS485 operation: Install the jumper shunt onto J3. For Serial1 RS485 operation: Install the jumper shunt onto "1 485En" (J4). We have been using Microcontroller Development Boards like Arduino, Raspberry Pi, NodeMCU, ESP8266, MSP430, etc. for a long time now in our small projects where most of the times distance between the sensors and board is not more than few centimeters at max and at these distances, the communication between the different sensor modules, relays, actuators, rs485 cable and controllers can be easily done over simple jumper wires without us being worried about the signal distortion in the medium and the Electrical noises creeping into it. The connection between two or more elements (drivers and receivers) should be considered a transmission line if the rise and/or fall time is less than half the time for the signal to travel from the transmitter to the receiver. On the other hand, RS485 is more industry-based communication which is developed for a network of multiple devices that can be used over long distances and at greater speeds too. UART is an Asynchronous transmission device hence there is no clock signal to sync the data between the two devices instead it uses start and stop bits at the start and end of each data packet respectively to mark the extremities of the data being transferred.



One to two logic-high stop bits mark the end of a character. Because a mark (logic 1) condition is traditionally represented (e.g. in RS-232) with a negative voltage and space (logic 0) represented with a positive one, A may be considered the non-inverting signal and B as inverting. These signals may alternatively be redirected to the digital inputs and outputs used by the second serial port if hardware handshaking is required. The PDQ Board, however, does not implement hardware handshaking. 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. The PDQ Board’s transmit data signal /TxD1 (pin 2 on the 9-pin serial connector) is connected to the terminal’s receive data signal /RxD (pin 2 on its 9-pin connector). The QScreen Controller’s transmit data signal TxD1 (pin 2 on the 9-pin serial connector) is connected to the terminal’s receive data signal RxD (pin 2 on its 9-pin connector). It also has onboard LEDs to display the current state of the chip i.e. whether the chip is powered or its transmitting or receiving data making it easier to debug and use.



This UART-RS485 Converter module has an on-board MAX485 chip which is a low-power and slew-rate-limited transceiver used for RS-485 communication. In this tutorial, we are going to learn about the RS485 communication protocol and how to implement it with the two Arduino Nano we have with us and how to use the MAX485 RS485 to UART conversion Module. We start with including the standard library for driving the LCD and declare the D8 pin of the Arduino Nano as an output pin which we will later use to declare the MAX485 Module as a transmitter or Receiver. We will pull the enable pin high to put the MAX485 module in transmitter mode. We will send some data from the transmitter side over the cable from the Nano which is converted to RS485 signals via MAX RS485 Module working in Master Mode. We will pull the enable pin high to put the MAX485 module in receiver mode. Do note that both transmitter and receiver circuits look identical the only thing that differs is the code written into it.



Note that the master device outputs the clock synchronization signal SCK to the slave’s SCK which is configured as an input. However, note that the functions that write to EEPROM disable interrupts for 20 msec. It controls the serial-to-parallel and parallel-to-serial conversion and performs all of the timing functions necessary for asynchronous serial communications. RS-485 is used for low-speed data communications in commercial aircraft cabins' vehicle bus. 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. 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. Two asynchronous communications ports named Serial1 and Serial2 can each be configured for RS232 or RS485 protocols.

6131dKuiXbL.jpg