Use your forum account to login.

LOGIN

TOP Contributors

  1. MikroElektronika Team (452 codes)
  2. Shawon Shahryiar (246 codes)
  3. Alcides Ramos (97 codes)
  4. Dany (66 codes)
  5. O B (61 codes)
  6. MikroBUS.NET Team (35 codes)
  7. NART SCHINACKOW (34 codes)
  8. Alberto Trasimeni (25 codes)
  9. Roman Toropov (25 codes)
  10. Arezki YOUYOU (24 codes)

Most Downloaded

  1. Timer Calculator (78341 times)
  2. Network Ethernet Library (38043 times)
  3. FAT32 Library (37062 times)
  4. USB Device Library (28701 times)
  5. Network WiFi Library (27410 times)
  6. FT800 Library (20161 times)
  7. PID Library (19026 times)
  8. GSM click - Example (18596 times)
  9. microSD click - Example (15965 times)
  10. GPS click - Example (12784 times)
Libstock prefers package manager

Package Manager

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]

< Back
Example

RS485 3 Click

Rating:

Author: MikroElektronika Team

Last Updated: 2017-11-23

Category: CAN / LIN / RS485

Downloaded: 69 times

Not followed.

RS485 3 click uses SN65HVD31DR from Texas Instruments, a tri-state differential line driver and differential input line receiver. The click is intended to be used as UART to RS422/RS485 communication interface. It is suited for transmitting smaller blocks of data over long distances, using the four-wire bus, allowing for full-duplex communication.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "RS485 3 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "RS485 3 Click" changes.

Do you want to report abuse regarding "RS485 3 Click".

  • Information
  • Comments (0)

Example Blog

RS485 3 click

RS485 3 click

Front and back view of the RS485 3 click

View full image

The demo application is composed of two sections :

  • System Initialization - Initializes GPIO pins used for button press detection, and two UART modules: first one used for click and second used for logging.
  • Application Task - (Code snippet) Constantly polls the state of GPIO pin used for button press detection. Whenever the press is detected, a predefined message will be sent using RS485 3 click. At the same time, inside the application task, the UART is constantly polled, checking for RS485 3 click activity. Whenever new data on click is received, it will be logged to UART module.
void applicationTask()
{
//SENDS DATA
    if (Button( &GPIOA_IDR , 5, 100, 1 ))
    {
        for (i = 0; i <= 7; i++)
        {
            UART3_Write( SEND_DATA [ i ] );
        }
        UART1_Write_Text("Data sent");
    }

//RECEIVE AND LOG DATA 
    if (UART3_Data_Ready())
    {
        tmp = UART3_Read();
        UART1_Write(tmp);
    }
}

Other mikroE Libraries used in this example:

  • UART

Additional notes and information

Depending on the development board you are using, you may need USB UART clickUSB UART 2 clickor 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.

ALSO FROM THIS AUTHOR

USB Host Library

USB Host Library presents the user set of functions required to handle USB host module. A embedded user application program uses API defined in this library to access USB host peripheral.

[Learn More]

SpeakUp API

API for SpeakUp, the speech recognition click board

[Learn More]

FTDI click - Example

This is demonstration project how FTDI click can be used to control slave microcontroller via I2C. Lower nibble of slave address is masked which enables the master to address slave using eight different addresses. Currently four addresses are implemented for different functionality.

[Learn More]