This example demonstrates the LON mode provided by the USART peripherals on SAMV7 Microcontrollers.
Requirements
This package can be used with SAMV71 Xplained Ultra board or SAME70 Xplained board. Before running, make sure to connect two boards with RS485 lines. The rs485 adapt board (ADM3485ARZ) for this purpose. Match each paired pins of two boards respectively with A to A, B to B and FGND to FGND(the central pin of J3). this part is connect with EK and ADM3485ARZ
- Board 1 Board 2
- TXD1(J507 pin28, D47) <->DI TXD1(J507 pin28, D47) <->DI
- RXD1(J507 pin27, D46) <->RO RXD1(J507 pin27, D46) <->RO
- RTS1(J507 pin26, D45) <->DE RTS1(J507 pin26, D45) <->DE
- CTS1(J507 pin25, D44) <->RE CTS1(J507 pin25, D44) <->RE
- 3.3v 3.3v
- GND GND this part is connect with 2 ADM3485ARZ A <--------------------> A B <--------------------> B PGND <--------------------> PGND
Description
This example connects two boards through RS485 interface to show how to use USART in LON (local operating network) mode. One of the board acts as the transmitter and the other one as the receiver. It is determined by the sequence the two applications started.
Usage
- Build the program and download it inside the board. Please refer to the Getting Started with SAM V71/E70 Microcontrollers.pdf
- Connect a serial cable to the UART4 port (J505 Pin3 D18 and Pin4 D19) on the evaluation kit.
- On the computer, open and configure a terminal application for each board (e.g. HyperTerminal on Microsoft Windows) with these settings:
- 115200 baud rate
- 8 bits of data
- No parity
- 1 stop bit
- No flow control
- Start application from two boards in sequence. Make sure the second board should NOT be started unless the first board had run to wait for the synchronizing character. The output message in later section would describe this.
- In the terminal window, the following text should appear (values depend on the board and chip used):
-- USART LON Mode Example xxx --
-- SAMxxxxx-xx
-- Compiled: xxx xx xxxx xx:xx:xx --
References