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-02-05
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: RS485
Downloaded: 2842 times
Not followed.
License: MIT license
RS485 Isolator 2 Click features ADM2867E a 5.7 kV rms signal and power isolated full duplex RS-485 transceiver. The device also features cable invert pins, allowing the user to quickly correct reversed cable connection on A, B, Y, and Z bus pins while maintaining receiver full receiver fail-safe performance.
Do you want to subscribe in order to receive notifications regarding "RS485 Isolator 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "RS485 Isolator 2 click" changes.
Do you want to report abuse regarding "RS485 Isolator 2 click".
Library Description
Initializes and defines UART bus driver, and defines drivers for reading, writing and check for new data between RS485 Isolator 2 clicks. User can also enable or disable both transmiter and receiver, and to invert receiving or transmitting data.
Key functions:
void rs485isolator2_write_byte ( uint8_t input )
- Writes single byte.uint8_t rs485isolator2_read_byte( )
- Read received byte.uint8_t rs485isolator2_byte_ready ( )
- Checks is there a new byte received.Examples description
The application is composed of three sections :
void application_task ( )
{
char tmp;
uint8_t drdy_flag;
if ( app_mode == APP_MODE_RECEIVER )
{
// RECEIVER - UART polling
rs485isolator2_re_state( RS485ISOLATOR2_ENABLE_RE );
drdy_flag = rs485isolator2_byte_ready( );
if ( 1 == drdy_flag )
{
tmp = rs485isolator2_read_byte( );
mikrobus_logWrite( &tmp, _LOG_BYTE );
}
rs485isolator2_re_state( RS485ISOLATOR2_DISABLE_RE );
}
else
{
// TRANSMITER - TX each 2 sec
rs485isolator2_de_state( RS485ISOLATOR2_ENABLE_DE );
for ( tmp = 0; tmp < demo_message_lenght; tmp++ )
{
rs485isolator2_write_byte( demo_message_data[ tmp ] );
}
rs485isolator2_de_state( RS485ISOLATOR2_DISABLE_DE );
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.