Skip to main content

RS485

{{@218#bkmrk-open-iot-and-iiot-ga}}

Link to repositories:

In this example:

  • transceiver 1 (A1 and B1 pins) is configured as a receiver
  • transceiver 2 (A2 and B2 pins) is configured as a transmitter

Connection

Connect RS485_1 port to the portsRS485_2 as shownport in the picture.loopback configuration.

2b37eca5-97fe-41e5-9a3e-a218fbc71eb5.pngimage.png

Description

InThis thisexample wayshows therehow to handle the RS485 communication via UART and UART-RS485 MAX481 converter. There is a possibility to doalso a testfunction implemented for each line termination via the 74HC595BQ shift register. After flashing both ports should send and adaptread todata workingfrom witheach externalother. devices. On the developer side there is an option to configure serial port parameters.

Default

Console settings:

  • baud rate: 115200
  • data bits: 8
  • parity bits: 0
  • stop bits: 1
  • receiver timeout: 3s

Voltage levels in RS485 standard are equal to MCU logic levels 0-3.3 V

After flashing, open serial port monitor and find out if the demo works properly.

output

400b776b-a0ea-4079-b1ce-b182dbbc7959.pngimage.png