Programmable Keyboard-Display Interface - 8279
Programmable Keyboard-Display Interface - 8279
Programmable Keyboard-Display Interface - 8279
interface - 8279
a programmable keyboard and display interfacing chip.
scans and encodes up to a 64-key keyboard.
controls up to a 16-digit numerical display.
the display is controlled from an internal 16x8 ram that stores the coded
display information.
the first 3 bits of # sent to control port selects one of 8 control words.
keyboard interface of 8279
first three bits given below select one of 8 control registers (opcode).
000ddmmm
mode set: opcode 000.
dd sets displays mode.
mmm sets keyboard mode.
encoded: sl outputs are active-high, follow binary bit pattern 0-7 or 0-15.
decoded: sl outputs are active-low (only one low at any time).
pattern output: 1110, 1101, 1011, 0111.
strobed: an active high pulse on the cn/st input pin strobes data from the
rl pins into an internal fifo for reading by micro later.
010z0aaa
the read fifo control word selects the address (aaa) of a keystroke from the
fifo buffer (000 to 111).
z selects auto-increment for the address.
011zaaaa
the display read control word selects the read address of one of the display
ram positions for reading through the data port.
100zaaaa
selects write address -- z selects auto-increment so subsequent writes go to
subsequent display positions.
interface of 8279
1010wwbb
the display write inhibit control word inhibits writing to either the
leftmost 4 bits of the display (left w) or rightmost 4 bits.
bb works similarly except that they blank (turn off) half of the output
pins.
1100ccfa
the clear control word clears the display, fifo or both
bit f clears fifo and the display ram status, and sets address pointer to
000.
if cc are 00 or 01, all display ram locations become 00000000.
if cc is 10, --> 00100000, if cc is 11, --> 11111111.
1110e000
end of interrupt control word is issued to clear irq pin in sensor matrix
mode.
1) clock must be programmed first. if 3.0 mhz drives clk input, ppppp is
programmed to 30 or 11110.
interface of 8279
2) keyboard type is programmed next.
the previous example illustrates an encoded keyboard, external decoder used
to drive matrix.
interface of 8279
code given in text for reading keyboard.
data returned from 8279 contains raw data that need to be translated to ascii:
row and column number are given the rightmost 6 bits (scan/return).
this can be converted to ascii using the xlat instruction with an ascii code
lookup table.
the ct and sh indicate whether the control or shift keys were pressed.
the strobed keyboard code is just the state of the rlx bits at the time a 1
was `strobed' on the strobe input pin.
six digit display interface of 8279
used for controlling real-time events such as real-time clock, events counter,
and motor speed and direction control.
the control word allows the programmer to select the counter, model of
operation, binary or bcd count and type of operation (read/write).
8254 programming
each counter may be programmed with a count of 1 to ffffh.
minimum count is 1 all modes except 2 and 3 with minimum count of 2.
each counter has a program control word used to select the way the counter
operates.
if two bytes are programmed, then the first byte (lsb) stops the count, and
the second byte (msb) starts the counter with the new count.
8254 modes
mode 1: one-shot mode.
the g input triggers the counter to output a 0 pulse for `count' clocks.
counter reloaded if g is pulsed again.
8254 modes
mode 3: generates a continuous square-wave with g set to 1.
if count is even, 50% duty cycle otherwise out is high 1 cycle longer.