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.

U11 is a 74HCT138 3-to-8-line decoder that generates individual chip-enable signals for<br />

eight 1K blocks in the memory area from E000h to FFFFh. It works the same way that U6<br />

generates chip selects for 8K blocks in the main circuit.<br />

U11 is enabled whenever pin 7 of U6 is low, which occurs when the 8052-BASIC reads or<br />

writes to addresses from E000h to FFFFh.<br />

Address lines A10, A11, and A12 determine which of U11’s outputs goes low when the chip<br />

is enabled. As with U6, each output is low for a different memory area. For example, pin 15<br />

is low only when addresses from E000h to E3FFh are being read or written to.<br />

One possible point of confusion is that both pin 7 of U6 ( in Figure 3-1) and pin 15 of U11<br />

are chip-selects with a starting address of E000h. One controls memory accesses in the entire<br />

8K block from E000h to FFFFh, while the other controls only the 1K block from E000h to<br />

E3FFh. To distinguish the two, I’ve labeled U11’s pin 15 as E000H-1K.<br />

U12 and U14 are examples of input and output ports that U11 can enable.<br />

An Input Port<br />

Inputs and Outputs<br />

U12 is a 74LS244 octal buffer that adds eight inputs to the circuit. <strong>The</strong> buffer’s Y outputs<br />

connect to the system’s data bus (D0-D7). <strong>The</strong> chip has two groups of four buffers, with each<br />

having its own enable input (1G and 2G). For this application, the enables are tied together,<br />

and all eight buffers are accessed as a group.<br />

I used an LSTTL device for the buffer rather than a CMOS 74HC244 for a couple of reasons.<br />

<strong>The</strong> LSTTL chip has Schmitt-trigger inputs, which are less sensitive to noise. Plus, unlike<br />

CMOS, the LSTTL buffer requires no pull-up resistors at unused inputs.<br />

OR gate U9B ensures that U12 is enabled only when U2 (the 8052-BASIC chip) reads an<br />

address from E000h to E3FFh. When this occurs, output-enable pins 1 and 19 go low, the<br />

buffer’s outputs follow its inputs, and U2 reads the data that U12 has placed on D0-D7.<br />

After a read operation, pins 1 and 19 go high and U12’s outputs are high-impedance. In other<br />

words, the outputs are electrically similar to an open circuit, which ensures that they won’t<br />

interfere with other operations on the data bus.<br />

In the circuit, U12 is read-only. Write operations to E000h have no effect. To access U12 at<br />

a different address, wire pin 4 of U9B to a different output of U11.<br />

Memory decoding options. Note that although U12 holds just one byte of information to<br />

read, you can access it at any address from E000h to E3FFh. This may seem like a waste of<br />

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

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

Saved successfully!

Ooh no, something went wrong!