Difference between revisions of "EPC-R5710 Serial Port(RS-232、RS-422、RS-485)"
From ESS-WIKI
Xingxing.li (talk | contribs) |
Xingxing.li (talk | contribs) |
||
Line 35: | Line 35: | ||
# echo "okk" > /dev/ttymxc3 | # echo "okk" > /dev/ttymxc3 | ||
okk</pre> | okk</pre> | ||
+ | |||
Line 55: | Line 56: | ||
</pre> | </pre> | ||
− | [[File:EPC-R5710 RS422.png|1000x800px]] | + | [[File:EPC-R5710 RS422.png|1000x800px|EPC-R5710 RS422.png]] |
'''Com3''' | '''Com3''' | ||
Line 63: | Line 64: | ||
</pre> | </pre> | ||
− | [[File:EPC-R5710 RS422 1.png|1000x800px]] | + | [[File:EPC-R5710 RS422 1.png|1000x800px|EPC-R5710 RS422 1.png]] |
+ | |||
+ | === '''RS-485 Test''' === |
Revision as of 09:11, 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