Difference between revisions of "EPC-R5710 Serial Port(RS-232、RS-422、RS-485)"
Xingxing.li (talk | contribs) (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...") |
Xingxing.li (talk | contribs) |
||
(4 intermediate revisions by the same user not shown) | |||
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: 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> | ||
+ | |||
+ | [[File:EPC-R5710 RS422.png|1000x800px|EPC-R5710 RS422.png]] | ||
+ | |||
+ | '''Com3''' | ||
+ | <pre># 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 | ||
+ | </pre> | ||
+ | |||
+ | [[File:EPC-R5710 RS422 1.png|1000x800px|EPC-R5710 RS422 1.png]] | ||
+ | |||
+ | |||
+ | |||
+ | === '''RS-485 Test''' === | ||
+ | |||
+ | '''Step1: description'''<br/> COM2 and COM3 need to be configured under uboot as either of 232, 485, 422 modes<br/> Example both as 485: | ||
+ | <pre>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 | ||
+ | </pre> | ||
+ | |||
+ | '''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:'''<br/> Adam-4520I Pin 1: Data- connect to DB9 Pin 1<br/> Adam-4520I Pin 2: Data+ connect to DB9 Pin 2 | ||
+ | |||
+ | [[File:EPC-R5710 DB9 connector pin.png|RTENOTITLE]] | ||
+ | |||
+ | '''Step 3: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 test > /dev/ttymxc2 | ||
+ | </pre> | ||
+ | |||
+ | [[File:EPC-R5710 RS-485.png|1000x800px]] | ||
+ | |||
+ | '''Step 4:Com3''' | ||
+ | <pre># 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 | ||
+ | </pre> | ||
+ | |||
+ | [[File:EPC-R5710 RS485 COM3.png|1000x800px]] |
Latest revision as of 09:25, 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
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
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
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
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