Practical Electronics Handbook, Sixth Edition

Even the simplest microcontroller system has to interface to the outside world in some way. There are many ways by which this is achieved and this chapter is a survey of some useful techniques. The reader will note that the methods mentioned here are aimed at the sort of microcontroller system, usually described as embedded applications, that might be built into systems to provide user interface or specific automation functions. It is not the purpose of the chapter to cover general purpose computers or personal computers.
The seven-segment numeric display is probably the single most recognizable feature of the digital age. The segments of the display are named by convention a to g with an eighth segment providing a decimal point. Figure 12.1 shows the arrangement and the state of the segments for displaying the numbers 0 to 9. The hex codes assume that the most significant bit (MSB) drives the a segment; the decimal point is then the least significant bit and can be turned on by adding 1 to the hex code. Driving a display in this way uses one 8-bit-wide microprocessor port per digit.
Seven-segment displays have been made with light-emitting diodes, liquid crystal displays, vacuum fluorescent displays, filament lamps and even solenoid-operated flags. We will concentrate on the LED (Figure 12.2) and LCD types here since these are the commonest and have...