You are on page 1of 27

The 8279 is designed to connect to the 8086 system bus.

Two small memories contain information to be displayed and the keypad input.
16 bytes can be stored in the display RAM
8 bytes can be saved in the FIFO/Sensor RAM
The codes for the seven segment displays are written to the display RAM.
The FIFO (First-In -First-Out) contains the row and column information of the
key that is pushed. In the sensor matrix mode, a bit is set in the row and
column of the key that is pushed.
Two display formats are available, which are called left entry mode and right
entry mode. It would be better if these are referred to as fixed and variable
entry modes, since left and right entry depends on how the 8279 is connected
to the displays.
The Scan Counter can be either encoded ( counts 0 to 0FH) or decoded ( 1 out
of 4 lines is active). The SDK-86 uses the encoded mode since it has eight
displays.

8279 Control Word Summary

8279 Commands
The commands are sent to port 0FFEAH.
The three most significant bits in the command word identify the command.
Keyboard/Display Mode Set
[000DDKKK]
DD
00
01
10
11

8 8-bit character display - left entry (SDK-86)


16 8-bit character display - left entry
8 8-bit character display - right entry
16 8-bit character display - right entry

KKK
000
001
010
011
100
101
110
111

Encoded Scan Keyboard - 2 key lockout (SDK-86)


Decoded Scan Keyboard - 2 key lockout
Encoded Scan Keyboard - N key rollover
Decoded Scan Keyboard - N key rollover
Encoded Scan Sensor Matrix
Decoded Scan Sensor Matrix
Strobed Input, Encoded Display Scan
Strobed Input, Decoded Display Scan

2 key lock out mode :


In this mode one key must be released before another keypress will be
detected and pressed.

N-key rollover mode :


In this mode if two keys are pressed at nearly the same time, both
keypresses will be detected and debounced and their codes put in the
FIFO RAM in the order the keys were pressed.

Program
Divide the external clock to getClock
the 100 kHz operating frequency.
[001PPPPP]
PPPPP is the number that divides the clock to get 100 kHZ which is the
scan rate.
On the SDK-86, the clock pin on the 8279 is connected to the 2.5 MHz PCLK
signal. This must be divided by 25 = 19H = 110012 to get 100 kHz. Therefore,
the command word is
[ 0 0 1 1 1 0 0 1] = 39H

II-25

Read FIFO/Sensor
Sets up the 8279 so that the next read of 0FFE8H puts the contents of the
RAM
FIFO on the data pin.
[ 0 1 0 AI X A A A ]
The SDK-86 uses the Scan Keyboard mode where the AI and AAA bits are
irrelevant. The command to read the FIFO is
[ 0 1 0 0 0 0 0 0 ] = 40H
Read Display RAM
Since we write the display RAM, we dont often use this command.
[ 0 1 1 AI A A A A]
AI is the auto-increment bit and AAAA is the address. If AI is set, the
address is automatically incremented.

II-26

FIFO Data Format


The SDK-86 uses the 8279 in scanned keyboard mode meaning that the
row and column information of the key press is put into the FIFO to be
read by the processor.
row col
control
shift
For example, if the key in row 1 and column 2 is pushed, then the FIFO
contains
[0 0 0 0 1 0 1 0 ]
row

col

The control and shift inputs are grounded on the SDK-86.

8279 Status Word


DE OU F N N N
Number of
characters in FIFO
FIFO full
Underrun
Overrun
Error Flag
Display Unavailable

Data Sheet
0 1 2

3 4

SDK-86

5 6 7

5 4 3 2

1 0

Left Entry Mode - 8 Character Display - the numbers above the boxes are fixed.
1

2 3

4 5 6

7 0

7 6 5 4

3 2 1

Right Entry Mode - the numbers shift before the data is output.
The SDK-86 is wired so that the numbers are reversed from the data sheet.
In the autoincrement mode, the data is written in consecutive locations until a
new command is sent. Right entry mode as shown in the data sheet is the input
mode used by a calculator. If you make a mistake entering data on a calculator
you clear the entry and start over.

Write Display RAM


This command sets up the 8279 to receive data for the display RAM
on the next write to 0FFE8H.
[ 1 0 0 AI A A A A ]
AAAA is the display RAM address. If the autoincrement bit AI is set,
AAAA is incremented after each write to 0FFE8H. For example, to output
four characters on the left side of the display from a byte array DISP.
MOV
MOV
OUT
MOV
MOV
MOV
BACK: MOV
OUT
INC
LOOP

DX,0FFEAH
AL,94H
DX,AL
DX,0FFE8H
CX,4
SI,0
AL,DISP[SI]
DX,AL
SI
BACK
7 6 5 4

; write the command


; loop count
; output the data to displays 4,5,6,7
; loop 4 times
3 2 1 0

SDK-86 display
II-27

Other
A B A B
Commands
Display Write Inhibit/Blanking [ 1 0 1 X IW IW BL BL ]
Inhibits or blanks A0-A3 and/or B0-B3. This disrupts the character display.

Clear
[ 1 1 0 Cd Cd Cd Cf Ca ]
[ 1 1 0 1 0 0 1 1 ] = 0D3H clears the display (outputs 0s to segments)
These 2 bits = 1 turns on all the segments.

End Interrupt
[1110XXXX]

Initializing and Communicating with an 8279


Sample Program for Initialization
MOV DX, 0FFEAH
; Points to 8279 Control Address
MOV AL, 000 00 000B ; Mode set word
OUT DX, AL
; Send to 8279
MOV AL, 001 11000B
; Clock word (Divide clock by 24)
OUT DX, AL
MOV AL, 110 10000B
; Clear Display char is all zeros
Sample Program to Send Seven Segment code to Display RAM
MOV DX, 0FFEAH
; Points to 8279 Control Address
MOV AL, 100 10000B
; Write Display RAM, First Location than Auto-increment
OUT DX, AL
MOV DX, 0FFE8H
; Points to 8279 Data Address
MOV AL, 6FH
; Seven Segment code for 9
OUT DX, AL
; Send to 8279 Display RAM
Sample Program to Read Keyboard code form FIFO
MOV DX, 0FFEAH
; Points to 8279 Control Address
MOV AL, 010 00000B
; Control word to read FIFO RAM
OUT DX, AL
MOV DX, 0FFE8H
; Points to 8279 Data Address
IN AL, DX
; Read FIFO RAM

You might also like