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.

Chapter 6<br />

the newly latched data. <strong>The</strong> falling edge of RD brings INTR low again as the CPU reads the<br />

data.<br />

Output Control. For output ports in Mode 1, there is a complementary set of signals:<br />

OBF (output buffer full output) goes low to indicate that the CPU has written data to U12.<br />

OBF can signal a peripheral device (a display, for example) that it’s time to read data that the<br />

8255 is holding for it.<br />

ACK (acknowledge input) strobes low to tell the 8255 that the peripheral device has read the<br />

data. ACK’s falling edge brings OBF high.<br />

INTE (interrupt enable) is set to enable INTR. Its function is similar to its function for Mode<br />

1’s inputs, except that Group A uses bit 6 of Port C, and Group B uses bit 2 of Port C.<br />

INTR (interrupt request output) goes high to signal that a peripheral has accepted the data<br />

written to U12. <strong>The</strong> falling edge of WR brings INTR low, and INTR goes high again when<br />

ACK and OBF are both high and INTE is set, to signal that the peripheral has read and<br />

acknowledged the data.<br />

For both inputs and outputs, connecting INTR is optional.<br />

Mode 1 leaves two bits of Port C unused. If Port A is input, the unused bits are 6 and 7. If<br />

Port A is output, the bits are 4 and 5. You can use these as general-purpose inputs or outputs.<br />

Bit 3 of the mode-select control word selects an input or output function for both bits.<br />

Mode 2 (Strobed Bidirectional Bus I/O) is similar to Mode 1, except that data can flow both<br />

ways. Mode 2 can use all of the control signals used by Mode 1’s input and output modes,<br />

and is available only for Port A. With Port A in Mode 2, Port B can be Mode 0 or 1, input<br />

or output. <strong>The</strong> remaining three bits of Port C (0-2) can also be input or output, selected with<br />

the control word.<br />

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

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

Saved successfully!

Ooh no, something went wrong!