Figure 5-2 Terminal software interface
27
5.3
5.3
RS-485
Loopback
Test
RS-485 Loopback Test
This demonstration illustrates a loopback test through RS-485 interfaces using the UART protocol.
Channel 0 of the RS-485 interface (marked as Profibus-1) connects to RS-485 channel 1. Software
running on Nios II will first set channel 0 on transmit state and channel 1 on receive state, then it
initiates one data transfer with its content set by SW7-0 through channel 0. Once the data is
received by the RS-485 controller on channel 1 side, software will set channel 1 on transmit state
and channel 0 on receive state then sends data back to the loop. The RS-485 controller on channel 0
side finally gets the passed back data and compares it to the original data. The same procedure will
be carried out for channel 2 and 3 except transmit data is set by SW15-8. The result will be
indicated on HEX3-0 and HEX7-4 as well as Nios II IDE.
shows the block diagram of
the test system.
Figure 5-3 Block diagram of the RS-485 loopback test