Arduino Ethernet 的另一性价比选择
来自Jack's Lab
(版本间的差异)
(以“Arduino Ethernet 的另一性价比选择:ENC28J60 网络模块 文件:enc28j60.jpg 该模块的 taobao 售价现在在 19 人民币左右,相对于 W51...”为内容创建页面) |
|||
第21行: | 第21行: | ||
<source lang=bash> | <source lang=bash> | ||
− | git clone git://github.com/ | + | git clone git://github.com/jcw/ethercard.git ethercard |
</source> | </source> | ||
2014年6月25日 (三) 17:12的最后版本
Arduino Ethernet 的另一性价比选择:ENC28J60 网络模块
该模块的 taobao 售价现在在 19 人民币左右,相对于 W5100 那是相当的给力,对于需要使用多片 Arduino + Ethernet 进行控制的同学可以考虑下
仔细看看该模块,可见其核心主要是 enc28j60 这个集成块,Arduino 可通过 SPI 读写其内部寄存器,该芯片的详细描述可参考这个中文文档 ENC28J60 数据手册
EN28J60 模块在 Arduino 环境下,可以使用 Jean-Claude Wippler 封装的 ethercard 库
ethercard 库的使用:
1. 下载 ethercard 库
git clone git://github.com/jcw/ethercard.git ethercard
2. 把 ethercard 移入 /PATH/TO/Arduino-1.0.1/libraries 下,这样 Arduino IDE 就能调用这个库
3. 引脚连接
ENC28J60 模块的引脚有 10 个,只要连接 7 根线即可工作:
* Vcc --> 3.3v * GND --> GND * RESET --> RESET
SPI 的四根线:
* ATmega1280/2560: MOSI --> 51; MISO --> 52; SCK --> 53, SS --> 8 * Others (ATmega328 ...): MOSI --> 11; MISO --> 12; SCK --> 13, SS --> 8
4. 开启一个 Arduino IDE 窗口,依次进入菜单 File -> Examples -> ethercard -> rbbb_server
编译后,upload 到板子,插上网线,浏览器直接访问之,可得一计时页面: