TCP/IP Lean: Web Servers for Embedded Systems, Second Edition

Having chosen a microcontroller and looked at the techniques for miniaturizing the TCP/IP stack, you now have to implement these ideas. First I'll look at the additional hardware devices that will be needed, and I'll produce a complete circuit diagram. The circuit is sufficiently simple that a prototype can be hand-wired without much difficulty. Alternatively, a commercially produced board can be purchased.
I'll then look at the code for modem emulation, serial (SLIP) interface, IP, and TCP, ending up with a fully working system that will respond to ICMP Pings and accept TCP Daytime requests. This will make a firm foundation on which to build your miniature Web server, which is covered in Chapter 11.
A Web server needs ample storage for Web pages, and the on-chip ROM is clearly inadequate for this. Conventionally, you would add memory to a microcontroller using an external address and data bus, but I've deliberately chosen a device with a small pin count, which has no provision for external memory addressing. A satisfactory alternative is to use an external device with a synchronous (clocked) serial interface (Figure 10.1). There are a wide range of devices available, generally using a four-wire or two-wire interface (plus power and ground).
A four-wire device has a clock line, chip select, and data input and output. The microcontroller starts a transaction by asserting the chip select line then toggles the clock line to mark each data bit as it is...