Sei sulla pagina 1di 3

8279

The 8279 is a hardware approach to interfacing a matrix keyboard and a multiplexed display.
The disadvantage of using software approach is that the microprocessor is occupied for a
considerable amount of time in checking the keyboard and refreshing the display (if the CPU
gets involved in doing some lengthy task which cannot be interrupted to refresh the display,
only one digit of the display will be left lit). The 8279 relieves the processor from these two
tasks.
The disadvantage of 8279 is cost.
The trade-offs between the hardware approach and the software approach is the production
cost versus the processor time and the software development cost.
The 8279 is a 40 pin device with two major segments: Keyboard and Display.
Keyboard segment can be connected to a 64-contact key matrix. Keyboard entries are de
bounced and stored in the internal memory (FIFO), while an interrupt signal is generated
with entry.
Display segment can provide sixteen-character scanned display interface with such devices
as LEDs. This segment has 16 * 8 R/W memory (RAM), which can be used to read/write
information for display purpose.

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

Sample Program with procedure to Display contents of CX register on SDK-86 LED Displays.
DATA SEGMENT WORD PUBLIC
SEVEN_SEG
DB
DB
DATA ENDS

3FH, 06H, 5BH, 4FH, 66H, 6DH, 7DH, 07H


7FH, 6FH, 77H, 7CH, 39H, 5EH, 79H, 71H

PUBLIC DISPLAY
CODE SEGMENT
ASSUME CS: CODE, DS: DATA
DISPLAY PROC FAR
PUSHF
PUSH DS
PUSH AX
PUSH BX
PUSH CX
PUSH DX
MOV AX, DATA
MOV DS, AX
MOV DX, 0FFEAH
CMP AL, 00H
JZ DATAFLD
MOV AL, 100 10100B
JMP SEND
DATAFLD:
MOV AL, 100 10000B
SEND: OUT DX, AL
MOV BX, OFFSET (SEVEN_SEG)
MOV DX, 0FFE8H
MOV AL, CL
AND AL, 0FH
XLATB
OUT DX, AL
MOV AL, CL
MOV CL, O4H
ROL AL, CL
AND AL, 0FH
XLATB
OUT DX, AL
MOV AL, CH
AND AL, 0FH
XLATB
OUT DX, AL
MOV AL, CH
ROL AL, CL
AND AL, 0FH
XLATB
OUT DX, AL
POP DX
POP CX
POP BX
POP AX
POPF
RET
DISPLAY ENDP
CODE ENDS
END

; Save Flags and Registers

; Initialize Data Segment


; Points to 8279 Control Address

;
;
;
;
;
;

Pointer to Seven Segment Codes


Points to 8279 Data address
Get low byte to be displayed
Mask upper nibble
Translate lower nibble to seven segment code
Send to 8279 Display RAM

; Transfer data from CL to AL


;
;
;
;
;
;
;
;

Rotate 4 times to exchange Nibbles


Mask upper nibble
Translate lower nibble to seven segment code
Send to 8279 Display RAM
Get high byte to translate
Mask upper nibble
Translate lower nibble to seven segment code
send to 8279 Display RAM

;
;
;
;
;

rotate to exchange nibbles


Mask upper nibble
Translate lower nibble to seven segment code
Send to 8279 Display RAM
Restore all Flags and Registers

Potrebbero piacerti anche