We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2020-03-03
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: RS485
Downloaded: 3504 times
Not followed.
License: MIT license
RS485 6 Click is offers a half-duplex RS-485 communication with integrated surge protection, which can be used as an interface between the TTL level UART and the RS485 communication bus. It is based on THVD1429DT, a transceiver from Texas Instruments with signaling rate of up to 20 Mbps.
Do you want to subscribe in order to receive notifications regarding "RS485 6 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "RS485 6 click" changes.
Do you want to report abuse regarding "RS485 6 click".
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 datauint8_t rs4856_read_byte( )
- Read single byte of datauint8_t rs4856_byte_ready ( )
- .Examples description
The application is composed of three sections :
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 );
}
}
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.