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

Chapter 10: TCP/IP on a PICmicro Microcontroller

Overview

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.

Peripherals

External Memory

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).


Figure 10.1: External device interfaces.

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...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Bit Error Rate Testers
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.