Statement: Interface an 8 x 8 matrix keyboard to 8085 through 8279 in 2-key lockout mode and write an assembly language program to read keycode of the pressed key. The external clock frequency is 2MHz. Use I/O mapped I/O technique.
Home
8085 Forum
8085 Free Projects
8085 Free Programs
8085 Tutorials
8085 details
Interfacing Techniques
Electronic Tutorials
Electronic Projects
Assembler/ IDE
Datasheets
Guest Book
About Me


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

HARDWARE FOR 8 x 8 MATRIX KEYBOARD INTERFACE(With Interrupt)

SOFTWARE FOR 8 x 8 MATRIX KEYBOARD INTERFACE(With Interrupt)



The three steps needed to write the software are:
       Step 1: Find keyboard/display command word.
       

Step 2: Find program clock command word
       
Step 3: Find Read FIFO/sensor RAM command word.
FLOWCHART




Fig. shows the interfacing of 8 x 8 matrix keyboard in interrupt driven keyboard mode. In the interrupt driven mode interrupt line from 8279 is connected to the one of the interrupt input of 8085 except INTR. Here, INT line from 8279 is connected to the interrupt RST 7.5 of 8085. Other signal connections are same as in the non interrupt mode.

Note: In the interrupt driven keyboard, when key is pressed, key code is loaded into FIFO RAM and interrupt is generated. This interrupt signal is used to tell CPU that there is a keycode in the FIFO RAM. CPU then initiates read command with in the interrupt service routine to read key code from the FIFO RAM.