8279 Keyboard and Display Controller
8279 Keyboard and Display Controller
Keyboard and
Display
Controller
The INTEL 8279 is specially developed for interfacing keyboard and display
devices to 8085/8086/8088 microprocessor based system. The important
features of 8279 are,
SL0 – SL3
RD*
WR*
CS* OUT B0- B3
A0 Display Pins
OUT A0 – A3
RESET
CLK BD*
VCC VSS
CPU interface
Pins
Pins of 8259 can be divided into
Scan pins
SHIFT It is a special key input line. In case of typewriter keyboard, the shift key
is connected to this line. The signal on this line is recognized in scanned
keyboard mode only. The status of this key is stored in FIFO RAM. But
the line is not scanned by 8279.
Display
The four major sections of 8279 are keyboard, scan, display
and CPU interface.
Keyboard section
Display section
Scan section
and B0-B3.
• The output lines can be used either as a single group of eight lines or as
two groups of four lines, in conjunction with the scan lines for a
multiplexed display.
• The output lines are connected to the anodes through driver transistor
• The display section consists of 16 x 8 display RAM. The CPU can read
to-4 decoder.
• In encoded scan mode, the output of scan lines will be binary count,
• The scan lines are used to form the rows of a matrix keyboard and
ON/OFF.
CPU interface section
• The CPU interface section takes care of data transfer between 8279 and
the processor.
• This section has eight bidirectional data lines DB0 to DB7 for data
transfer between 8279 and CPU.
• It requires two internal address A =0 for selecting data buffer and A = 1
for selecting control register of8279.
• The control signals WR (low), RD (low), CS (low) and A0 are used for
read/write to 8279.
• It has an interrupt request line IRQ, for interrupt driven data transfer
with processor.
• The 8279 require an internal clock frequency of 100 kHz. This can be
obtained by dividing the input clock by an internal pre scaler.
• The RESET signal sets the 8279 in 16-character display with two -key
lockout keyboard modes.
Programming the 8279:
•The 8279 can be programmed to perform various functions through eight
command words.
All timing and multiplexing signals for the 8279 are generated by an internal
prescaler. This prescaler divides the external clock (pin 3) by a programmable integer.
Bits PPPPP determine the value of this integer ranges from 2 to 31.
Example:
Choosing a divisor that yields 100 kHz will give the specified scan and debounce
times. For instance, if Pin 3 of the 8279 is being clocked by a 2 MHz signal, PPPPP
should be set to 10100 to divide the clock by 20 to yield the proper 100 kHz
operating frequency.
Example:
When the control word set to 2Ch (00101100b), the program clock command is
enabled (001) and the prescaler value = 12 (01100b).
At the result, the internal clock of the 8279 is equal to
( 2.4576 MHz /12=204.8 KHz).
In general Prescalar value = (external Clock / 100 KHz) ; for proper operation.
Read FIFO/Sensor RAM
The CPU sets the 8279 for a read of the FIFO/Sensor RAM by first writing this
command. In the Scan Keyboard Mode, the Auto-Increment flag (AI) and the RAM
address bits (AAA) are irrelevant.
The 8279 will automatically drive the data bus for each subsequent read (A0=0) in the
same sequence in which the data first entered the FIFO.
All subsequent reads will be from the FIFO until another command is issued.
In the Sensor Matrix Mode, the RAM address bits AAA select one of the 8 rows of the
Sensor RAM.
If the AI flag is set (AI=1), each successive read will be from the subsequent row of the
sensor RAM.
Read Display RAM
The CPU sets up the 8279 for a read of the Display RAM by first writing this command.
The address bits AAAA select one of the 16 rows of the Display RAM.
If the AI flag is set (AI=1), this row address will be incremented after each following
read or write to the Display RAM.
Since the same counter is used for both reading and writing, this command sets the
next read or write address and the sense of the Auto-Increment mode for both
operations.
Write Display RAM
The CPU sets up the 8279 for a write to the Display RAM by first writing this
command. After writing the command with A0=1, all subsequent writes with A0 = 0
will be to the Display RAM.
The address and Auto-Increment functions are identical to those for the Read
Display RAM.
However, this command does not affect the source of subsequent Data Reads; the
CPU will read from whichever RAM (Display of FIFO/Sensor) which was last
specified. If, indeed, the Display RAM was last specified, the Write Display RAM
will, nevertheless, change the Next Read location.
Display Write Inhibit/Blanking
Inhibit Nibble A
0=> Normal Operation
1=> Inhibit or Freeze Nibble A display
Inhibit Nibble B
0=> Normal Operation
1=> Inhibit or Freeze Nibble B display
Blank Nibble A
0=> Normal Operation
1=> Blank Nibble A display
Blank Nibble B
0=> Normal Operation
1=> Blank Nibble B display
This code defaults to all zeros after a reset. Note that both BL flags must be set to blank a
display formatted with a single 8-bit port.
Clear
The CD bits are available in this command to clear all rows of the Display RAM to a
selectable blanking code as follows :
During the time the Display RAM is being cleared (~160 μs), it may not be written to. The
most significant bit of the FIFO status word is set during this time. When the Display RAM
becomes available again, it automatically Resets.
If the CF bit is asserted (CF = 1), the FIFO status is cleared and the interrupt output line is
reset.
Also, the Sensor RAM pointer is set to row 0.
CA, the Clear All bit, has the combined effect of CD and CF; it uses the CD clearing code on
the Display RAM and also clears FIFO status. Furthermore, if resynchronizes the internal
timing chain.
End Interrupt/Error Mode Set
For the sensor matrix modes this command lowers the IRQ line and enables further
writing into RAM. (The IRQ line would have been raised upon the detection of a
change in a sensor value.
This would have also inhibited further writing into the RAM until reset).
For the N-key rollover mode - if the E bit is programmed to “1” the chip will operate in
the special Error mode.
In a microprocessor based system, when keyboard
and 7-segment LED display is interfaced using
ports or latches then the processor has to carry
the following task.
•Keyboard scanning
•Key debouncing
•Key code generation
•Sending display code to LED
•Display refreshing
Interfacing 8279 with 8085 processor:
•A typical Hexa keyboard and 7-segment LED display interfacing circuit using 8279 is shown.
Interfacing 8279 with 8 X 4 matrix keyboard
Source program:
MVI A, 00H : Initialize keyboard/display in
encoded
OUT 81H : scan keyboard 2 key lockout
mode
MVI A, 34H
OUT 81H : Initialize prescaler count
MVI A, 0BH : Load mask pattern to enable
RST 7.5
SIM : mask other interrupts
EI : Enable Interrupt
HERE: JMP HERE : Wait for the interrupt
Interrupt Subroutine:
MVI A, 40H : Initialize 8279 in read FIFO
OUT 81H : RAM mode
IN 80H : Read FIFO RAM (keycode)
EI : Enable Interrupt
RET : Return to main program
Interfacing 8279 with 8 X 8 matrix keyboard (decoded mode)
SL2
SL1
SL0
74138
8279
Interfacing 8279 with seven segment display
Interfacing 8279 with 8 seven segment display (decoded
mode)
Source program:
MVI A, 00H : Initialize keyboard/display in encoded
OUT 81H : scan keyboard 2 key lockout mode
MVI A, 34H
OUT 81H : Initialize prescaler count
MVI A, 0BH : Load mask pattern to enable RST 7.5
SIM : mask other interrupts
EI : Enable Interrupt
HERE: JMP HERE : Wait for the interrupt