RS485 5 Click Board
RS485 5 Click Board
The RS485 5 Click Board™ is equipped with the MAX485, low-power, slew-rate-limited transceiver for RS-485 and RS-422 communication, from Maxim Integrated. This device supports half-duplex RS-485 communication and can be used as an interface between the TTL level UART and the RS485 communication bus.
Thanks to the low power consumption and reduced slew-rate drivers that minimize EMI and reduce reflections caused by improperly terminated cables, error-free data transmission up to 250kbps is supported.
The RS485 5 Click Board™ is perfectly suitable for EMI-Sensitive Applications, such as industrial-control local area networks, building automation, HVAC systems, and many more.
Software Support
We provide a library for the RS485 5 Click Board™ 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 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.
Example 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; 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); } }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
- UART
Additional Notes and Information
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
The RS485 5 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.
RS485 5 Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.