How does it work?
RS485 6 Click is designed to offer you easy usage and testing of the THVD1429DT half-duplex RS485 transceiver. One of the most important features is surge protection which is achieved by integrating transient voltage suppressor (TVS) diodes in the package. This feature provides a substantial increase in reliability for better immunity to noise transients coupled to the data cable, eliminating the need for external protection components.
An RS-485 bus consists of multiple transceivers connecting in parallel to a bus cable. To eliminate line reflections, each cable end is terminated with a termination resistor whose value matches the characteristic impedance of the cable. This method, known as parallel termination, allows for higher data rates over longer cable length. This device supports up to 256 Bus Nodes in one network with higher data rates up to 20 Mbps, in cases where the interconnect is short enough (or has suitably low attenuation at signal frequencies) to not degrade the data.
The THVD1329DT supports several functional modes that can be selected by using RE and DE pins on the mikroBUS connector. To know more how to use these modes take a look at the ???Device Functional Modes??? table below. For communication with the RS485 6 Click standard UART communication can be used.
This device offer several protections for the pins connected to a bus line, such as: Electrostatic Discharge (ESD) Protection against ±16-kV HBM and ±8-kV contact discharge, Electrical Fast Transient (EFT) Protection where inductive loads such as relays, switch contactors, or heavy-duty motors can create high-frequency bursts during transition and Surge transients that often result from lightning strikes (direct strike or an indirect strike which induce voltages and currents), or the switching of power systems, including load changes and short circuit switching. These transients are often encountered in industrial environments, such as factory automation and power-grid systems.
Since this device feature a wide common-mode voltage range which makes them suitable for multi-point applications over long cable runs. This Click board™ can be supplied and interfaced with both 3.3V and 5V without the need for any external components. The onboard SMD jumper labeled as VCC SEL allows voltage selection for interfacing with both 3.3V and 5V microcontrollers.
Specifications
Type |
RS485 |
Applications |
This device is perfectly suitable for wireless infrastructure, building automation, HVAC systems or factory automation, smart meters. |
On-board modules |
THVD1329DT a half-duplex RS-485 communication with integrated surge protection from Texas Instruments |
Key Features |
Surge protection on the RS485 Line, up to 256 nodes, signaling rate of up to 20 Mbps. |
Interface |
UART |
Compatibility |
mikroBUS |
Click board size |
S (28.6 x 25.4 mm) |
Input Voltage |
3.3V or 5V |
Pinout diagram
This table shows how the pinout on RS485 6 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes |
Pin |
|
Pin |
Notes |
---|
|
NC |
1 |
AN |
PWM |
16 |
NC |
|
|
NC |
2 |
RST |
INT |
15 |
DE |
Driver enable(active hight) |
Receiver Enable |
RE |
3 |
CS |
RX |
14 |
TXD |
UART transmit |
|
NC |
4 |
SCK |
TX |
13 |
RXD |
UART Receive |
|
NC |
5 |
MISO |
SCL |
12 |
NC |
|
|
NC |
6 |
MOSI |
SDA |
11 |
NC |
|
Power Supply |
3.3V |
7 |
3.3V |
5V |
10 |
5V |
Power Supply |
Ground |
GND |
8 |
GND |
GND |
9 |
GND |
Ground |
RS485 6 Click electrical specifications
Description |
Min |
Typ |
Max |
Unit |
---|
Supply Voltage Range |
-0.5 |
- |
7 |
V |
Signaling Rate |
- |
- |
20 |
Mbps |
Bus Voltage |
-15 |
- |
15 |
V |
Receiver Output Current |
-24 |
- |
24 |
mA |
Electrostatic Discharge |
- |
+/-16 |
- |
kV |
DEVICE FUNCIONAL MODES
INPUT |
ENABLE |
OUTPUTS |
FUNCTION |
---|
D |
DE |
A |
B |
---|
H |
H |
H |
L |
Active drive bus hight |
L |
H |
L |
H |
Active drive bus low |
X |
L |
Z |
Z |
Drive disabled |
X |
OPEN |
Z |
Z |
Driver disabled by default |
OPEN |
H |
H |
L |
Actively drive bus high by default |
Onboard settings and indicators
Label |
Name |
Default |
Description |
---|
LD1 |
PWR |
- |
Power LED indicator |
JP2 |
VCC SEL |
Left |
Power supply voltage selection: left position 3V3, right position 5V |
Software Support
We provide a library for the RS485 6 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.
Library Description
Library provides functions for comunication via UART module, and contol over RE and DE pins.
Key functions:
void rs4856_write_byte ( uint8_t input )
- Write single byte of data
uint8_t rs4856_read_byte( )
- Read single byte of data
uint8_t rs4856_byte_ready ( )
- .
Examples description
The application is composed of three sections :
- System Initialization - Intializes UART module
- Application Initialization - Driver intialization
- Application Task - Choose one mode (read or write) of task. If you reading it checks if data is ready to be read and then reads one byte and if you are wiriting send data via UART.
void application_task ( )
{
char tmp;
if ( app_mode == APP_MODE_RECEIVER )
{
// RECEIVER - UART polling
rs4856_re_pin_set( RS4856_PIN_STATE_LOW );
rs4856_de_pin_set( RS4856_PIN_STATE_LOW );
drdy_flag = rs4856_byte_ready( );
if ( 1 == drdy_flag )
{
tmp = rs4856_read_byte( );
mikrobus_logWrite( &tmp, _LOG_BYTE );
}
}
else
{
// TRANSMITER - TX each 2 sec
rs4856_re_pin_set( RS4856_PIN_STATE_HIGH );
rs4856_de_pin_set( RS4856_PIN_STATE_HIGH );
for ( tmp = 0; tmp < 9; tmp++ )
{
rs4856_write_byte( demo_message_data[ tmp ] );
}
Delay_ms( 2000 );
}
}
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or 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.
mikroSDK
This Click board™ is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.
Resources
Downloads