EPC-R5710 Serial Port(RS-232、RS-422、RS-485)

From ESS-WIKI
Jump to: navigation, search

For COM serial port pin definition, please refer to previous chapter 2.4 for more information.
Self connect the TXD and RXD of each COM port

RS-232 loopback Test

Step 1:  description
COM2 and COM3 need to be configured under uboot as either of 232, 485, 422 modes
Example both as 232:

COM Port node
COM2 /dev/ttymxc2
COM3 /dev/ttymxc3
u-boot=> setenv uart_mode 2:0,3:0
u-boot=> saveenv
Saving Environment to MMC...Writing to MMC(2)...<span style="color:#1abc9c;">OK</span>
u-boot=> reset

Step 2: Example com2 test :

# stty -F /dev/ttymxc2 -echo -onlcr 115200
# cat /dev/ttymxc2 &
# echo "Serial Port Test" > /dev/ttymxc2
Serial Port Test

Example com3 test:

# stty -F /dev/ttymxc3 -echo -onlcr 115200
# cat /dev/ttymxc3 &
# echo "okk" > /dev/ttymxc3
okk



RS-422 Test

Step 1: description
COM2 and COM3 need to be configured under uboot as either of 232, 485, 422 modes
Example both as 422:

u-boot=> setenv uart_mode 2:2,3:2
u-boot=> saveenv
Saving Environment to MMC... Writing to MMC(2)... OK
u-boot=> reset

Step 2:  Test RS-422 with Adam-4520I. Connect Adam-4520I to PC with DB9
Adam-4520I to comX as the following;
Adam-4520I RX- <--> DB9 Pin 1
Adam-4520I RX+ <-->DB9 Pin 2
Adam-4520I TX- <-->DB9 Pin 4
Adam-4520I TX+ <--> DB9 Pin 3

Step3: Com2

# stty -F /dev/ttymxc2 speed 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
# cat /dev/ttymxc2 &
# echo "Serial Test" > /dev/ttymxc2

EPC-R5710 RS422.png

Com3

# stty -F /dev/ttymxc3 speed 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
# cat /dev/ttymxc3 &
# echo "Serial Test" > /dev/ttymxc3

EPC-R5710 RS422 1.png


RS-485 Test

Step1: description
COM2 and COM3 need to be configured under uboot as either of 232, 485, 422 modes
Example both as 485:

u-boot=> setenv uart_mode 2:1,3:1
u-boot=> saveenv
Saving Environment to MMC...Writing to MMC(2)...<span style="color:#1abc9c;">OK</span>
u-boot=> reset

Step 2: Test RS-485 with Adam-4520I.Connect Adam-4520I to PC with DB9 cable.Connect Adam-4520I to COMX DB9 as the following:
Adam-4520I Pin 1: Data- connect to DB9 Pin 1
Adam-4520I Pin 2: Data+ connect to DB9 Pin 2

RTENOTITLE

Step 3:Com2

# stty -F /dev/ttymxc2 speed 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
# cat /dev/ttymxc2 &
# echo test > /dev/ttymxc2

EPC-R5710 RS-485.png

Step 4:Com3

# stty -F /dev/ttymxc3 speed 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
# cat /dev/ttymxc3 &
# echo test > /dev/ttymxc3

EPC-R5710 RS485 COM3.png