Introduction
This example demonstrates how to emulate a serial port between two devices. It reads input data from serial interface and sends it via Wi-Fi connection. The EDBG interface will print out messages you typed or received, hence simulating a chat application. To run this example you need to prepare two pairs of SAMD21 Xplained Pro board with WINC1500 extension (on EXT1 slot).
Main Files
- main.c : Initialize device and USART interface. Create TCP sockets, send/receive messages and print out them on the EDBG interface.
Usage
- Configure below code in the main.h for AP to connect to.
- Build the program and download it into each board.
- On the computer, open and configure a terminal application as the follows.
* Baud Rate : 115200
* Data : 8bit
* Parity bit : none
* Stop bit : 1bit
* Flow control : none
*
- Start the application.
- On the terminal window, the following text should appear:
* -- WINC1500 Wi-Fi Serial example --
* -- Compiled: xxx xx xxxx xx:xx:xx --
* Wi-Fi connected.
* Wi-Fi IP is xxx.xxx.xxx.xxx
*
- Check IP address of each board and execute connection on one device by typing the below command on the terminal window with the other device's address. Use prefix "<<" to execute local commands.
- If connected, the following text should appear:
* [Local device]
* Connecting to [xxx.xxx.xxx.xxx] ...
*
* [Remote device]
*
- Type messages on the terminal window and you will see the sent/received messages.
- You can control LED on the remote device by typing the following command. Use prefix ">>" to execute remote commands.
* >>control ledon
* or
* >>control ledoff
*
Compilation Information
This software was written for the GNU GCC compiler using Atmel Studio 6.2 Other compilers may or may not work.
Contact Information
For further information, visit Microchip.