Purpose
This example uses the Ethernet MAC (GMAC) and the on-board Ethernet
transceiver available on Atmel evaluation kits. It enables the device to
respond to a ping command sent by a host computer.
Requirements
- SAM microcontrollers with GMAC feature.
- On-board ethernet interface.
Description
Upon startup, the program will configure the GMAC with a default IP and
MAC address. If the device support AT24MAC EEPROM, EIA-48 MAC address is
stored in it. And then ask the transceiver to auto-negotiate the best mode
of operation. Once this is done, it will start to monitor incoming packets
and process them whenever appropriate.
The basic will only answer to two kinds of packets:
- It will reply to ARP requests with its MAC address,
- and to ICMP ECHO request so that the device can be PING'ed.
You may use 'ping' command to check if the board responds correctly to
ping requests.
Usage
-# Build the program and download it into the evaluation board.
-# On the computer, open and configure a terminal application
(e.g., HyperTerminal on Microsoft Windows) with these settings:
- 115200 bauds
- 8 bits of data
- No parity
- 1 stop bit
- No flow control
-# Connect an Ethernet cable between the evaluation board and the network.
The board may be connected directly to a computer; in this case,
make sure to use a cross/twisted wired cable such as the one provided
with the evaluation kit.
-# Start the application. It will display the following message on the terminal:
-- GMAC Example --
-- SAMxxxxxx-xx
-- Compiled: xxx xx xxxx xx:xx:xx --
MAC 00:45:56:78:9a:bc
IP 192.168.0.2
- The program will then auto-negotiate the mode of operation and start receiving packets, displaying feedback on the terminal. To display additional information, press any key in the terminal application.
- To test if the board responds to ICMP ECHO requests, type the following command line in a shell: Response to 'ping' cmd will appear in the shell.
- Note
- Make sure the IP address of the device(EK board) and the computer are in the same network.