6. 编译并下载程序。
程序运行后,我们会发现串口中没有出现之前所说的Assertion警告,而是提示DHCP分配IP地址成功:
DHCP分配成功!
IP地址: 192.168.1.116
子网掩码: 255.255.255.0
网关: 192.168.1.1
打开PC端的命令提示符cmd,输入“ping ENC28J60”,检查是否可以ping通我们设置的计算机名:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Octopus>ping ENC28J60
Pinging ENC28J60 [192.168.1.116] with 32 bytes of data:
Reply from 192.168.1.116: bytes=32 time=2ms TTL=255
Reply from 192.168.1.116: bytes=32 time=27ms TTL=255
Reply from 192.168.1.116: bytes=32 time=1ms TTL=255
Reply from 192.168.1.116: bytes=32 time=1ms TTL=255
Ping statistics for 192.168.1.116:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 27ms, Average = 7ms
C:\Users\Octopus>
然后打开浏览器,在地址栏输入“http://enc28j60”,看是否能打开网页。