Features of Intel 8279 Programmable Keyboard Display Interface
Features of Intel 8279 Programmable Keyboard Display Interface
Features of Intel 8279 Programmable Keyboard Display Interface
Interface:
2. Key data
3. Display data
4. Scan
CPU Interface Pins:
As shown in Fig. 14.83 (a), it consists of 8-bit data bus, RD, WR, A 0, CS,
RESET, CLK and IRQ lines.
DB0-DB7 : Bi-directional data bus :
All data, commands and status information between the CPU and the
8279 are transmitted on these bi-directional 8-bit data bus.
RD : Read:
It is an active low signal. When RD signal is low CPU reads the contents
of selected register (display RAM, status register or FIFO RAM) from
8279; depending on the type of command and the status of the A0
signal.
WR : Write:
It is an active low signal. When WR signal is low, CPU loads the data into
selected register (control register or display register) depending on the
status of A0 signal.
A0 : Address line:
When A0 is high, signals are interpreted as a command or status. When
A0 is low, signals are interpreted as a data.
CS : Chip select :
It is an active low signal. When low, enables the communication
between CPU and 8279.
RESET : A high signal on this pin resets 8279. After being reset 8279 is
configured in the following mode.
1. Sixteen 8-bit character display-left entry
CLK : This signal is usually driven by the system dock and used to
generate internal timings.
IRQ : Interrupt Request :
This signal is used to implement interrupt driven input system. In
scanned keyboard mode, the interrupt line goes low when there is data
in the FIFO/sensor RAM. The interrupt line goes low with each
FIFO/sensor RAM read and returns high if there is still information in
the RAM. In sensor matrix mode, the interrupt line goes high whenever
a change in a sensor is detected. The IRQ line is cleared by the first data
read operation if the auto increment flag is set to zero, or by the End
interrupt command if the Auto-increment flag is set to one. The
interrupt feature of Pin Diagram of 8279 eliminates the need of polling
the keyboard.
Keyboard Data:
Fig. 14.84 shows the 8279 Block Diagram. It consists of four main
sections
1. CPU interface and control section
2. Scan section
3. 8279 Keyboard section
4. Display section
1.CPU Interface and Control Section:
This section consists of data buffers, I/O control, control and timing
registers, and timing and control logic.
Data Buffers
The data buffers are 8-bit bi-directional buffers that connect the
internal data bus to the external data bus.
I/O Control
The I/O control section uses the A0, CS, RD and WR signals to control
data flow to and from the various internal registers and buffers. The
data flow to and from the Block Diagram of 8279 is enabled only when
CS = 0; otherwise the 8279 signals are in a high impedance state. The
Block Diagram of 8279 interprets the data given or desired by the CPU
with the help of A0, RD and WR signals, as shown in table 14.8. When
A0 is logic 0 data is transferred and when A 0 is logic 1 command word or
status word is transferred. RD and WR determine -the direction of data
flow through the data buffers.
The control and timing registers store the keyboard and display modes
and other operating conditions programmed by the CPU. The modes
are programmed by sending the proper command on the data lines
with A0 = 1. The command is latched on the rising edge of WR. The
command is then decoded and the appropriate mode/function is set.
Timing Control:
The timing control consists of the basic timing counter chain. The first
counter is divided by N prescaler that can be programmed to give an
internal frequency of 100 kHz. The other counters divide down the
basic internal frequency, to provide the proper keyscan, row scan,
keyboard matrix scan, and display scan times. The internal frequency of
100 KHz gives the internal timings as shown in the table 14.9.
The scan section has a scan counter which has two modes : Encoded
mode and decoded mode.
Encoded Mode:
In the encoded mode, the scan counter provides a binary count from
0000 to 1111 on the four scan lines (SC3 — SC0) with active high
outputs. This binary count must be externally decoded to provide 16
scan lines.
Display can use all 16 scan lines to interface 16 digit 7-segment display,
but keyboard can use only 8 scan lines out of 16 scan lines.
Decoded Mode:
In the decoded mode, the internal decoder decodes the least significant
2 bits of binary count and provides four possible combinations on the
scan lines (SC3 — SC0) :1110, 1101, 1011 and 0111. Thus the output of
decoded scan is active low. These four active low output lines can be
used directly to interface 4 digit 7 segment display, 8 x 4 matrix
keyboard, eliminating the external decoder.
3. 8279 Keyboard section:
The 8 return lines (RL7 — RL0) are buffered and latched by the return
buffers during each row scan in scanned keyboard or sensor matrix
imode In strobed input mode, the contents of the return lines are
transferred to the FIFO RAM on the rising edge of the CNTL/STB line
pulse.
Keyboard debounce and control:
FIFO RAM status keeps track of the number of characters in the FIFO
and whether it is full or empty. The status logic also makes IRQ signal
high when the FIFO is not empty, which can be used to interrupt CPU
telling that key press is detected and keycode is available in FIFO RAM.
4. Display section:
The display address registers hold the address of the byte currently
being written or read by the CPU and scan count value. The read/write
addresses are programmed by CPU command. If set in auto
increment mode, address in the address register is incremented for
each read or write.
Display registers:
Display registers are two 4-bit registers A and B. They hold the bit
pattern of character to be displayed. The contents of display registers A
and B can be blanked and inhibited individually.
3. Strobed input
Scanned Keyboard:
In this mode, keyboard can be scaned in two ways : Encoded scan and
decoded scan.
Encoded scan : In the encoded scan, scan lines (SL2-SL0) are decoded
externally to provide 8 scan lines. We know that Operating Modes of
8279 provides 8 returns lines. Therefore, the maximum size of
keyboard matrix is 8 x 8 = 64. When the key is pressed, 8279 stores the
encoded status of scan lines and return lines along with the status of
SHIFT and CNTL/STB keys into the FIFO RAM, as shown in the Fig. 14.85.
CNTL is
the MSB of the character and shift is the next most significant bit. The
next three bits are from the scan counter. The last three bits indicate to
which return line the key is connected. With this 8-bit key code
Operating Modes of 8279 can recognize 256 (28) different characters.
Display Modes:
All timing and multiplexing signals for the Operating Modes of 8279 are
generated by an internal prescaler. This prescaler divides the external
clock by a programmable integer value given in the program clock
command word, to generate internal frequency Fig. 14.90 shows
format for program clock command word.
Bits PPPPP determine the value of this integer which ranges from 2 to
31. To give proper scan and key debounce times the internal frequency
should be 100 kHz. Therefore, prescaler integer value should be
selected to get 100 kHz internal frequency.
Here, four least significant bits (AAAA) Specify the address ‘of the 16
byte display RAM and bit B4, if 1, enables autoincrement mode. If the
bit B4 (AI) is set, display RAM address is incremented after each read
command to display RAM.
Write Display RAM Command (100):
Here, four least significant bits (AAAA) specify the address of the 16
byte display RAM and bit B4, if 1, enables autoincrement mode. If the
bit B4 (AI) is set, display RAM address is incremented after each write
command to display RAM.
Display Write Inhibit/Blanking Command (101):
We know that, display RAM data is sent on the two 4-bit ports (B 3 —
B0 and A3 —A0) This two 4-bit pots can be individually inhibited or
blanked with display write inhibit/blanking command. Fig. 14.94 shows
the format for display write Inhibit/Blanking Command
The IW bits are used to mask nibble A (4-bit port A) and nibble B (4-bit
port B) in applications requiring separate 4-bit display ports. By setting
the IW flag (I/W = 1) for one of the ports, the port can be masked so
that entries to the display RAM from the CPU do not affect other port.
The BL bits are used to blank the individual nibbles. This command
loads the blank code (All zeros, 20H, or All ones) determined by the last
issued clear command, in the display RAM to blank the display.
Note : After reset blank code is set to all zeros.
Clear Command (110):
Clear command is used to clear all the rows of the display RAM with a
selectable blanking code, to clear status of FIFO RAM and to reset
interrupt output line. Fig. 14.95 shows the format of display command
CD bits (CD0 — CD1 ) are used to select the blanking code as given below
For the N key rollover mode, if the E bit is programmed to ‘1’, the 8279
will operate in the Special Error Mode. In the special error mode, if two
keys are depressed during single debounce, the error flag in the FIFO
status word is set.
Fig. 14.100 shows the interfacing of 8279 with 8086 in I/O mapped I/O
technique. Here RD and WR signals are activated when M/IO signal is
low, indicating I/O bus cycle. Reset out signal from 8086 system is
connected to the Reset signal of the 8279. CLK input of 8279 is driven
from the clock signal of 8086 system. A1 signal from the 8086 is
connected to the A0 input of 8279. The chip select signal, CS is
generated using decoding circuit. Interrupt signal from the 8279 is
connected to the interrupt input of 8086.
Interfacing 8279 with 8086 in Memory Mapped I/0: