Documente Academic
Documente Profesional
Documente Cultură
Keypad De-Bouncing
key bounce, tBOUNCE key bounce, tBOUNCE typically, tBOUNCE < 10 ms
NONE
NONE NONE
NONE
Description
Hardware approach to interfacing a matrix keyboard and a multiplexed display. Disadvantage of the software approach is that the microprocessor is occupied for a considerable amount of time in checking the keyboard and refreshing the display. 40 pin device. has two major segments : Keyboard & Display. Keyboard is connected to a 64-contact key matrix. Keyboard entries are debounced and stored in the internal FIFO memory; an interrupt signal is generated with each entry. Display segment can provide a 16-character scanned display interface and has 168 RAM, which can be used to read/write information for display purposes. Display can be set up in either right-entry (Calculator) (or) left-entry (Typewriter) mode.
Data Buffers
I/O Control
88 FIFO/Sensor RAM
Scan Counter
SL0-SL3
Return
SHIFT CNTL/STB RL0-RL7
OUT A0-A3
OUT B0-B3
3) Scan Section
4) Display Section
Continued. A0 0 0 RDbar WRbar 1 0 0 1 Operation MPU writes the data in 8279 MPU reads the data from 8279
1
1
1
0
0
1
Keyboard Section
Includes 88 FIFO (First In First Out) RAM consisting of eight (8) registers that can store eight (8) keyboard entries. Each is then read in the order of entries. The status logic (FIFO/Sensor RAM Status) keeps track of the number of entries and provides an IRQ (Interrupt Request) signal when the FIFO is not empty. Has eight return lines (RL7-RL0), connected to the eight columns of a keyboard.
Continued
has two additional lines : SHIFT & CNTL/STB. status of the SHIFT & CNTL (control) key can be stored along with the key closure. The keys are automatically debounced , and the keyboard can be operated in either of the two modes, (i) Two-key lockout : if two keys are pressed simultaneously, only the first key is recognized. (ii) N-key roll over : simultaneously pressed keys are stored in the internal buffer and no key is recognized until only one key remains pressed.
Scan Section
has a scan counter & four scan lines (SL3-SL0). Scan lines (4) can be decoded by using a 4-to-16 decoder to generate 16 lines for scanning. These lines can be connected to the rows of a matrix keyboard.
Display Section has eight (8) output lines divided into two groups A0-A3 & B0-B3. can be used either as a group of 8 lines (or) as two groups of four. display can be blanked by using BD Includes 168 display RAM. MPU can read (or) write into any of these registers.
0
D 0 1 0 1 K 0 0 1 1 0 0 1 1
K
Operation
Eight 8-bit character display-Left entry Sixteen 8-bit character display-Left entry Eight 8-bit character display-Right entry Sixteen 8-bit character display-Right entry K 0 1 0 1 0 1 0 1 Operation Encoded Scan Keyboard-2 key lockout 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
All timing & multiplexing signals for 8279 are generated by an internal prescalar. Pre-scalar divides the external clock by a programmable integer. Bits PPPPP determine the value of this integer which ranges from 2 to 31.
CPU sets up 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. (i.e) 8279 will automatically drive the data bus for each subsequent read in the same sequence in which the data first entered the FIFO RAM. In the sensor matrix mode, the RAM address bits AAA select one of the 8 rows of the Sensor RAM and if AI=1, each successive read will be from the subsequent row of the sensor RAM.
AI
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 AI=1, this (current) row address is incremented after each write command to the display RAM.
AI
CPU sets up the 8279 for a write to the Display RAM by first writing this command. The address bits AAAA select one of the 16-rows of the Display RAM. If AI=1, this (current) row address is incremented after each read command to the display RAM.
Code
IW
IW
BL
BL
IW bits can be used to mask nibble A & nibble B in application requiring separate 4bit display ports. By setting IW flag (IW=1), for one of the ports, the port becomes masked. The BL flags are available for each nibble.
(7) Clear
Code 1 1 0 CD2 CD1 CD0 CF CA CD2-CD0 bits available in this command are used to clear all rows of the display RAM to a selectable blanking code as follows:
CD2 1 1 1 CD1 0 1 1 CD0 X 0 1 Function All zeros (for common cathode displays) AB=(20)H=(0010 0000)B (for alphanumeric displays) All ones (for common anode displays)
If CF=1, FIFO status is cleared & the interrupt output line is reset. CA =1, clear all bits. (has the combined effect of CD bits and CF).
In sensor matrix mode, this command lowers the IRQ (Interrupt Request) line and enables further writing into RAM. In N-key roll over mode, if E=1, the chip will operate in the special error mode.
1.Write a command word to read third location with autoincrement of the sensor RAM in sensor matrix mode
Code
0 1 0
1 0 AI X
0 A
1 A
1 A
2.Write a command word to write fifth location without auto-increment of the display RAM
Code
1 0 0
0 0 AI A
1 A
0 A
1 A
3.Write a command word to read fourth location with autoincrement of the display RAM
Code
0 1 1
1 0 AI A
1 A
0 A
0 A
4.Write a command word to inhibit nibble A & to blank nibble B of the display
Code
1 0 1
Code
1 1 1
1 0 E
0 X
0 X
0 X
0 X
6.Give the command word to set keyboard/display for the following configuration: (i) Encoded scan keyboard N Key rollover (ii) Sixteen 8-bit character display Left entry
Code
0 0 0
0 D
1 D
0 K
1 K
0 K
7.Write a command word to set blanking code for common anode display & to clear the FIFO RAM Status
Code
1 1 0
1
CF
0
CA
Blanking code for common anode display is all ones (CD1 & CD0).
Code
1 P
0 P
1 P
0 P
0 P
To give proper scan & key debounce times, the internal frequency should be 100 KHz
Pre-scalar value = External Clock / Internal Frequency Pre-scalar value = (2x106) / (100x103) = (20)D = (10100)H = (PPPPP)