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-06-18
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: RS485
Downloaded: 2510 times
Not followed.
License: MIT license
The RS485 5 Click is a Click board equipped with the MAX485, low-power transceiver for RS-485 and RS-422 communication over UART interface for various automation systems, controllers, sensors and small embedded devices that can all share the same bus.
Do you want to subscribe in order to receive notifications regarding "RS485 5 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "RS485 5 click" changes.
Do you want to report abuse regarding "RS485 5 click".
Library Description
Library provides functions for communication over UART module with the device, controlling RE( Receiver Output Enable ) and DE( Driver Output Enable ) pins state.
Key functions:
void rs4855_write_byte ( uint8_t input )
- Function for writing data via UART module.uint8_t rs4855_read_byte( )
- Function for reading data via UART module.void rs4855_set_de_state( uint8_t state )
- Function for setting DE pin state.void rs4855_set_re_state( uint8_t state )
- Function for setting RE pin state.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
drdy_flag = rs4855_byte_ready( );
if ( 1 == drdy_flag )
{
tmp = rs4855_read_byte( );
mikrobus_logWrite( &tmp, _LOG_BYTE );
}
}
else
{
// TRANSMITER - TX each 2 sec
for ( tmp = 0; tmp < 9; tmp++ )
{
rs4855_write_byte( demo_message_data[ tmp ] );
mikrobus_logWrite( ">> MESSAGE SENT <<", _LOG_LINE );
}
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.