RS485 interface

The computer has two serial ports, one RS232 and one RS485. Both ports are optically isolated from the main computer circuit but not isolated from each other.

RS485

The baud rate range for the RS485 port is 600 bps ~ 921600 bps. Note that with a longer cable, the maximum speed may drop. It is recommended to use special cables designed for RS485. The port is protected by high-power TVS diodes against electrical surges.

We can access this using "/dev/ttyS1" port which you can check using "ls /dev/ttyS*" command

Testing setup

Insert SD Card and power on the board with defined power supply.

Download the Testing Script from above mentioned link and unzip the "AG1621_Script.zip" file in any folder.

Connect one end of RS485 to a USB cable with any laptop along with serial communication software/application and the other end with AG-1621 with cables as shown below.
 

RS485 Converter pinout AG-1621 pinout
A A
B B

Open any of the serial terminal applications like Hercules, terminal, etc., in a laptop with a default 115200 baud rate, Data bits is 8, Parity is None, stop bit is 1 and Handshaking is RTS/CTS.

Go to the AG1621_Script folder

AG1621_Script/Scripts/RS485

Run RS485 script 

sudo sh 485_com.sh

If asked for a password, then type "atreyo" and press enter. It starts printing output as per the below screenshot.

Once the Script starts running it will ask to enter any input from "send" or "receive" which the user needs to enter using the keyboard.

If you are typing "send" then it will again ask you to enter any string, put string and press enter. After this check in an externally connected laptop if the serial port application received the same message or not.


If you are typing "receive" then it will wait to receive an input from the other end so at that time send a string from the externally connected laptop's serial port application and then check whether the same string is received in AG-1621's terminal or not.

 If both ways receive the proper string then your RS485 communication working fine.

To stop running this script press ctrl + c shortcut.