18.11.2014 Views

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

In Figure 8-5’s circuit, an 82(C)55 controls the 7218C. For complete control, the circuit<br />

requires 10 outputs. Bits 0-4 of Port A determine the data to be written, including a decimal<br />

point controlled by ID7. If you don’t need the decimal point, tie pin 7 of the 7218C low. Bits<br />

5-7 of Port A select the digit to write to. If you have four or fewer displays, you can tie one<br />

or more of these lines low and free up another port bit.<br />

Port C, bit 4 controls WRITE. <strong>The</strong> display-mode input is tied high to select hexadecimal<br />

mode. If you instead tie pin 9 to a port bit, you can turn off the display by bringing the bit<br />

low. To allow selecting different modes, connect an additional output bit to the 7218D’s<br />

MODE input.<br />

Listing 8-3 uses the 7218D to display data, using Figure 8-5’s circuit.<br />

7-segment LCDs<br />

Displays<br />

An alternative to LEDs is liquid-crystal displays (LCDs). Unlike LEDs, which consume<br />

several milliamperes per segment, LCDs are voltage-controlled and require very little<br />

operating current.<br />

Compared to LEDs, LCDs are easy to read in bright light. However, because LCDs don’t<br />

emit light as LEDs do, but merely absorb or transmit it, you need additional lighting to see<br />

them in the dark. LCDs also tend to have narrower viewing angles than LEDs. So, whether<br />

to use LEDs or LCDs may depend on where and how you will use the display.<br />

Most 7-segment LCD modules contain two or more digits. Like the LEDs, a 7-segment LCD<br />

creates a numeral by turning on selected segments.<br />

Each LCD segment contains a thin layer of liquid crystal between two layers of glass. Liquid<br />

crystals are organic compounds that act as electrically controlled light polarizers. In a<br />

positive-image display (the most common type), applying a voltage across a segment causes<br />

the segment to appear dark, or opaque, while removing the voltage causes the segment to<br />

appear light-colored, or transparent. Negative-image displays are opaque when not powered,<br />

and transparent when powered. By applying and removing voltages across individual<br />

segments, you can display numeric, alphabetic, and other characters.<br />

Applying a constant voltage to an LCD segment will eventually destroy it. Instead, you must<br />

drive the segment with an alternating voltage, typically a square wave that alternately applies<br />

+5 and -5V across the segment.<br />

Single-digit driver. Figure 8-6 shows an LCD module driven by a 4543B LCD latch/decoder/driver.<br />

<strong>The</strong> 4543 is a lot like the 4511 LED driver, with the addition of a phase input<br />

that accepts a square wave for driving the segments. A typical drive frequency is around 100<br />

Hertz. A 555 timer provides the phase input, or you can use any oscillator output.<br />

<strong>The</strong> <strong>Microcontroller</strong> <strong>Idea</strong> <strong>Book</strong> 135

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!