Embedded ethernet enables microcontroller based projects to send and receive packets over the network. The board shown on the left is actual size and incorporates all the circuitry needed to enable 10BaseT communications. The board is designed to minimize the pin count needed to interface with microcontrollers. An 8 bit data bus, 4 bit address bus, and three control signals (15 signals) with an optional interrupt signal are all that is needed to control the board. This is made possible by using the Crystal CS8900 ethernet transceiver running in 8-bit mode. All the information, schematics, and source code needed to perform TCP/IP communication over ethernet is detailed on this page. I'm using a Microchip PIC16C74 controller in this project however, any controller with enouph port capacity will also work. This would include the popular Motarola 68HC11.
The project described here is in two parts. The actual embedded ethernet board and the test circuit utilizing the PIC16C74. The code running on the PIC incorporates the necessary drivers for the board along with the TCP/IP layers needed to communicate on the network.
Overview of the Crystal CS8900
The Crystal CS8900 is a single chip solution capable of interfacing directly to the analog side of 10BaseT ethernet using only an isolation transformer and some passive components. The CS8900 has 4K of integrated memory allowing it to receive and send packets asynchronous to the microcontroller. This eliminates any timing issues that would normally be present and allows even the slowest microcontroller to talk on the ethernet. The CS8900 itself, is running at 20Mhz and requires an external crystal. Most ethernet transceivers operate directly on the ISA bus and use DMA to access external RAM for incoming and outgoing packets and control information. The Crystal part also operates in this mode but also has an 8 bit mode. Using this mode is similar to controlling ports in the PC architecture. For a write operation, the address is placed on the address bus, say 0x300, the data is placed on the data bus and then and then the /IOW signal is toggled. Address decode logic on one of the boards "sees" that it's there port address (0x300) and then grabs the data from the data bus. For a read operation, the address, 0x300, is placed on the address bus and the /IOR signal is toggled, the card with this address places the data on the bus for the "in" instruction to read. This is how the CS8900 works in 8 bit mode and the default starting address for port access is 0x300 and continues to 0x30F. Notice that only 4 bits are really needed on the address bus to address all the register locations. Other address bus pins are tied either high or low. By manipulating these 16 register locations, you can control the entire 4K of internal memory known as PacketPage memory. Essentially, the CS8900 incorporates and indirect set of registers for controlling a much larger 4K area of internal memory on the part. For example, the documentation states that the length of the frame received is at location 0x0402 and 0x0403 (The CS8900 always uses 16 bit values) so you place the value 0x0402 into the PacketPage pointer location (0xa and 0xb) and read the data from the PacketPage data location (0xc and 0xd). The actual data you're reading is coming from the 0x0402 and 0x0403 locations within PacketPage memory. This technique is more completely described in the Crystal application note AN112.
Schematic of the embedded ethernet card shown above
This board was designed using ExpressPCB. The software for board layout design can be downloaded for free from their website and the ordering of boards is automated though the software package.
It should be mentioned that you will need to use a professionaly designed board for this project since the CS8900 is only available in a 100 pin QFP surface mount package. Don't panic! I didn't know anything about surface mount technology until I started this project, either. Here's the technique I use to solder the chip to the board:
The board layout uses ExpressPCB's softwareCS8900 Datasheet