One of the first things I wanted to buy when I got my Arduino board was an Ethernet shield. The ability to interface with the internet opens up a raft of possible applications for the device.
After picking my jaw up off the ground after seeing the price of the of the official Wiznet W5100 based Arduino Ethernet shield, I decided to go for the cheaper MicroChip ENC28J60 based nuelectronics Ethernet shield. The only problem was that by the time I had the funds to buy the shield, it had gone out of stock.
The solution was to either buy the ENC28J60 parts and build my own on a breadboard, or buy a ENC28J60 breakout board. I decided to splash out with the cash I saved compared to the official shield, and get both.
The nice thing about the breakout board compared to a Arduino shield, is that if I ever decide to change to another type of microcontroller, I can simply plug in and interface using the SPI bus, without being tied into the non-breadboard friendly Arduino shield format.
The my schematic is essentially the same as the nuelectronics schematic, only I replaced the SN74HCT08D with a SN74HC125N simply because I had one to hand.
The ENC28J60 runs at 3.3, while the ATmega328 runs at 5V. Normally this is a major problem, but luckily for us, the ENC28J60 is 5V tolerant. That means no level shifting is needed on the 5V lines controlled by the ATmega328 (CS, SCK, SI). The Tristate Buffer is used to shift the lines controlled by the ENC28J60 (SO, INT) from 3.3V to 5V. The lines never need to be put in a high impedance mode, so just tie the output enable line to ground.
Once connected, I downloaded Andrew Lindsay's EtherShield library, and uploaded the example webserver program to the Arduino, and voila...
user@host ~ $ ping 192.168.1.22 PING 192.168.1.22 (192.168.1.22): 56 data bytes 64 bytes from 192.168.1.22: icmp_seq=0 ttl=64 time=2 ms 64 bytes from 192.168.1.22: icmp_seq=1 ttl=64 time=1 ms 64 bytes from 192.168.1.22: icmp_seq=2 ttl=64 time=1 ms 64 bytes from 192.168.1.22: icmp_seq=3 ttl=64 time=1 ms
----192.168.1.22 PING Statistics---- 4 packets transmitted, 4 packets received, 0.0% packet loss round-trip (ms) min/avg/max/med = 1/1/2/1