Difference between revisions of "EPC-R5710 Serial Port(RS-232、RS-422、RS-485)"

From ESS-WIKI
Jump to: navigation, search
(Created page with " For COM serial port pin definition, please refer to previous chapter 2.4 for more information.<br/> Self connect the TXD and RXD of each COM port === '''RS-232 loopback Test...")
 
Line 35: Line 35:
 
# echo "okk" > /dev/ttymxc3
 
# echo "okk" > /dev/ttymxc3
 
okk</pre>
 
okk</pre>
 +
  
 
=== '''RS-422 Test''' ===
 
=== '''RS-422 Test''' ===
 +
 +
'''Step 1: description'''<br/> COM2 and COM3 need to be configured under uboot as either of 232, 485, 422 modes<br/> Example both as 422:
 +
<pre>u-boot=> setenv uart_mode 2:2,3:2
 +
u-boot=> saveenv
 +
Saving Environment to MMC... Writing to MMC(2)... OK
 +
u-boot=> reset
 +
</pre>
 +
 +
'''Step 2:&nbsp; Test RS-422 with Adam-4520I. Connect Adam-4520I to PC with DB9'''<br/> Adam-4520I to comX as the following;<br/> Adam-4520I RX- <--> DB9 Pin 1<br/> Adam-4520I RX+ <-->DB9 Pin 2<br/> Adam-4520I TX- <-->DB9 Pin 4<br/> Adam-4520I TX+ <--> DB9 Pin 3
 +
 +
'''Step3: Com2'''
 +
<pre># 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
 +
</pre>
  
 
&nbsp;
 
&nbsp;

Revision as of 09:07, 31 August 2023

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