Prices incl. GST
Out of Stock.
- Product Code: MIKROE-2821
- MPN: MIKROE-2821
RS485 3 click uses SN65HVD31DR from Texas Instruments, a tri-state differential line driver and differential input line receiver. The click is intended to be used as UART to RS422/RS485 communication interface. It is suited for transmitting smaller blocks of data over long distances, using the four-wire bus, allowing for full-duplex communication.
It can be used as a transceiver between UART interface and RS422/RS485 communication bus. RS485 3 click can be used for controlling various building automation systems, light controllers, sensors and many small embedded devices that can all share the same bus, which can stretch up to 254 nodes and up to 1200m in length.
How does it work?
The main feature of the RS422/RS485 interface is that the signals can be transmitted and received at distances up to 1200m by using the so-called twisted pairs - basically, the signal and its inverted copy are sent via the twisted pair wires. Because of the length of the twisted pair, it will unavoidably be exposed to the influence of the EMI. The interferences will appear in both wires of the twisted pair equally, but thanks to the opposite polarity of the signals the wires are carrying, the interferences will get canceled at the differential inputs of the SN65HVD31. This way, greater signal communication distances can be achieved than with the regular UART.
RS422/RS485 only specifies electrical characteristics of the transmitter and the receiver. It does not specify or recommend any communications protocol, only the physical layer. The top layer communication protocol of choice can be used, such as the MODBUS or DMX protocols.
To improve the signal stability, RS485 3 click is equipped with the TVS – transient voltage suppression diodes used to protect the circuit from the static electricity discharges and other types of dangerous electrical discharges, that might occur.
There are four onboard screw terminals (RX+, Rx-, Tx+, Tx-) for connecting RS422/RS485 twisted pair cable, along with two screw terminals (GND) for common ground connection.
TX and RX pins should be used for connecting MCU UART interface. Two resistors (R2 and R5) should be unsoldered if using more than two clicks on the RS422/RS485 bus.
Specifications
Type | RS485 |
Applications | Transceiver between UART interface and RS422/RS485 communication bus. Controlling various building automation systems, light controllers, sensors and small embedded devices that can all share the same bus. |
On-board modules | SN65HVD31DR 3.3-V Full-Duplex RS-485 Driver and Receiver by Texas Instruments |
Key Features | Full duplex four-wire serial communication over a distance up to 1200m, low power stand-by mode, receiver failsafe (detection of the short circuit or disconnection), hot plug capability |
Interface | UART |
Input Voltage | 3.3V |
Click board size | M (42.9 x 25.4 mm) |
Pinout diagram
This table shows how the pinout on RS485 3 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
RS485 3 click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Voltage at any terminal of the RS485 connectors | -7 | ±5 | 12 | V |
Differential load resistance | 54 | 60 | ? |
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
PWR | Power LED | - | Power LED indicates that the click is powered on |
Software support
We provide a demo application for the RS485 3 click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Examples Description
The application is composed of two sections :
- System Initialization - Initializes GPIO pins used for button press detection, and two UART modules: first one used for click and second used for logging.
- Application Task - (Code snippet) Constantly polls the state of GPIO pin used for button press detection. Whenever the press is detected, a predefined message will be sent using RS485 3 click. At the same time, inside the application task, the UART is constantly polled, checking for RS485 3 click activity. Whenever new data on click is received, it will be logged to UART module.
void applicationTask() { //SENDS DATA if (Button( &GPIOA_IDR , 5, 100, 1 )) { for (i = 0; i <= 7; i++) { UART3_Write( SEND_DATA [ i ] ); } UART1_Write_Text("Data sent"); } //RECEIVE AND LOG DATA if (UART3_Data_Ready()) { tmp = UART3_Read(); UART1_Write(tmp); } }
The full application code and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in this example:
- UART
Additional notes and information
Depending on the development board you are using, you may need USB UART click, USB UART 2 clickor RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.