This example demonstrates the MYD-AM335X series of the same type of two development board how to use the Linux API configuration development board on the RS485 and send and receive data,please refer to the source code for detail.
Hardware Preparation:
- Hardware debugging environment to see chapter2.
Board Type | MYD-AM335X | MYD-AM335X-Y | MYD-AM335X-J |
---|---|---|---|
RS485 interface | U16 4,5 Pin were connected to the same type of development board 4,5 Pin | CON2 5,4 Pin were connected to the same type of development board 5,4 Pin | JP2 and JP3 shorted,JP5 and JP7 shorted,J18 1,2,4,5 Pin were connected to the same type of development board 1,2,4,5 Pin |
Software Preparation:
- Linux Kernel 4.1.18
- tty_test application
Board Type | MYD-AM335X | MYD-AM335X-Y | MYD-AM335X-J |
---|---|---|---|
Device node | ttyO1 | ttyO2 | ttyO2 ttyO3 |
Test Steps:
- Copy cross compiled
<WORKDIR>/Examples/tty/tty_test
to/usr/bin
directory of the MYD-AM335X series development board, runtty_test
application as below:
1 |
# tty_test -h |
- One board is used as sender, the other is used as receiver, they communicate with tty_test application as below:
1 |
# tty_test -d /dev/ttyO1 -b 9600 -w "123456789" -m 1 -l |
- Execute the following command at other board to receive data as below:
1 |
# tty_test -d /dev/ttyO2 -b 9600 -m 1 -l |
- Exchange roles of the two boards, the result is the same.
近期评论