Intel mcs-48 manual Interface Considerations, Scanned Keyboard Mode, 2·Key Lockout

Models: mcs-48

1 478
Download 478 pages 26.88 Kb
Page 390
Image 390

8279/8279·5

INTERFACE CONSIDERATIONS

Scanned Keyboard Mode, 2·Key Lockout

There are three possible combinations of conditions that can occur during debounce scanning. When a key is depressed, the debounce logic is set. Other depressed keys are looked for during the next two scans. If none are encountered, it is a single key depression and the key position is entered into the FIFO along with the status of CNTL and SHIFT lines. If the FIFO was empty, IRQ will be set to signal the CPU that there is an entry in the FIFO. If the,FIFO was full, the key will not be entered and the error flag will be set. If another closed switch is encountered, no entry to the FIFO can occur. If all other keys are released before this one, then it will be entered to the FIFO. If this key is released before any other, it will be entirely ignored. A key is entered to the FIFO only once per depression, no matter how many keys were pressed along with it or in what order they were released. If two keys are depressed within the debounce cycle, it is a simultaneous depression. Neither key will be recognized until one key remains depressed alone. The last key will be treated as a single key depression.

Scanned Keyboard Mode, N·Key Rollover

With N-key Rollover each key depression is treated independently from all others, When a key is depressed, the debounce circuit waits 2 keyboard scans and then checks to see if the key is still down, If it is, the key is entered into the FIFO. Any number of keys can be depressed and another can be recognized and entered into the FIFO, If a simultaneous depression occurs, the keys are recognized and entered according to the order the keyboard scan found them,

Increment flag is set to zero, or by the End interrupt com- mand if the Auto-Increment flag is set to one.

Note: Multiple changes in the matrix Addressed by (SLo{j =0) may cause multiple Interrupts. (SLo=O in the Decoded Mode). Reset may cause the 8279 to see multiple changes.

Data Format

In the Scanned Keyboard mode, the character entered into the FIFO corresponds to the pOSition of the switch in the keyboard plus the status of the CNTL and SHIFT lines (non-inverted). CNTL is the MSB of the character and SHIFT is the next most significant bit. The next three bits are from the scan counter and indicate the row the key was found in. The last three bits are from the column counter and indicate to which return line the key was connected.

MSB

LSB

ICNTL !SHIFT!

+TUR~

SCANNED KEYBOARD DATA FORMAT

In Sensor Matrix mode, the data on the return lines is entered directly in the row of the Sensor RAM that corresponds to the row in the matrix being scanned. Therefore, each switch postion maps directly to a Sensor RAM position. The SHIFT and CNTL inputs are ignored in this mode. Note that switches are not necessarily the only thing that can be connected to the return lines in this mode. Any logic that can be triggered by the scan lines can enter data to the return line inputs. Eight multiplexed input ports could be tied to the return lines and scanned by the 8279.

Scanned Keyboard - Special Error Mode.

For N-key rollover mode the user can program a special error mode, This is done by the "End Interrupt/Error Mode Set" command. The debounce cycle and key-validity check are as in normal N-key mode, If during a single debounce cycle, two keys are found depressed. this is considered a simultaneous multiple depression. and sets an error flag. This flag will prevent any further writing into the FIFO and will set interrupt (if not yet set), The error flag could be read in this mode by reading the FIFO STATUS word, (See "FIFO STATUS" for further details,) The error flag is reset by sending the normal CLEAR command with

CF = 1.

Sen.or Matrix Mode

In Sensor Matrix mode, the debounce logic is inhibited. The status of the sensor switch is inputted directly to the Sensor RAM. In this way the Sensor RAM keeps an image of the state of the switches in the sensor matrix. Although debouncing is not provided. this mode has the advantage that the CPU knows how long the sensor was closed and when it was released. A keyboard mode can only indicate a validated closure. To make the software easier, the designer should functionally group the sensors by row since this is the format in which the CPU will read them.

The IRQ line goes high if any sensor value change is detected at the end of a sensor matrix scan. The IRQ line is cleared by the first data read operation if the Auto-

MSBLSB

In Strobed Input mode. the data is also entered to the FIFO from the return lines. The data is entered by the rising edge of a CNTLlSTB line pulse. Data can come from another encoded keyboard or simple switch matrix. The return lines can also be used as a general purpose strobed input.

MSBLSB

RL7! RLs IRLsl RL41 RL3! RL21 RL, ! RLo

Display

Left Entry

Left Entry mode is the simplest display format in that each display position directly corresponds to a byte (or nibble) in the Display RAM. Address 0 in the RAM is the left-most display character and address 15 (or address 7 in 8 character display) is the right most display character. Entering characters from position ze~o causes the display to fill from the left. The 17th (9th) character is entered back in the left most position and filling again proceeds from there.

9-75

AFN-00742A-D&

Page 390
Image 390
Intel mcs-48 manual Interface Considerations, Scanned Keyboard Mode, 2·Key Lockout