π Scanned Keyboard of 8279 (8 MCQs)
Automatic Keyboard Scanning and Key-Position Recognition
The scanned keyboard function of the 8279 continuously examines a matrix of switches connected between scan and return lines. It identifies key positions without requiring the 8085 to inspect each switch individually. The controller provides two principal scanned keyboard choices, two-key lockout and N-key rollover, both incorporating automatic key debouncing and FIFO storage.
Keyboard Matrix Connections and Return-Line Inputs
SL0βSL3 provide the scan sequence, while RL0βRL7 receive switch states. Encoded or decoded scanning determines how the scan signals select matrix rows. SHIFT and CNTL inputs can accompany key information as additional keyboard status, allowing programs to distinguish special key conditions.
Debounce Validation and FIFO Entry Generation
When a key closure is detected, the controller waits through its debounce checking interval and verifies that the key remains pressed. A valid key position is encoded and placed in the eight-character FIFO. IRQ indicates that keyboard data is available, and the processor retrieves entries in their order of arrival.
Example of Scanning a Keyboard with Multiple Keys
Assume the keyboard operates in encoded scan N-key rollover mode. A user presses two keys successively. The 8279 detects each key, validates both closures through debounce scanning and records their key codes in FIFO RAM. The processor reads the stored codes separately in their detected order.
Interaction Between Keyboard Modes and Processor Software
The scanned keyboard allows the processor to handle input only when valid key data becomes available. Two-key lockout prevents ambiguous simultaneous key recognition, while N-key rollover supports multiple-key entry. FIFO buffering preserves detected entries, and the CPU accesses them through the read FIFO command and ordinary data-read operations.
Misconceptions About Scanned Keyboard Operation
'The 8279 requires the CPU to scan every row' overlooks automatic scan generation. 'The FIFO stores only the latest pressed key' is incorrect because it maintains multiple entries. 'Debouncing removes all simultaneous key presses' confuses switch validation with the separate two-key lockout and N-key rollover selection.
Keyboard Scan Modes and FIFO-Handling Examination Questions
Identify the scan and return connections, debounce function and FIFO capacity. Compare two-key lockout and N-key rollover and explain how simultaneous closures are handled. Practise tracing a valid key through scanning, debounce verification, FIFO entry, IRQ generation and processor reading.
Scanned Keyboard and Key-Entry Terminology
- Scanned Keyboard - Matrix keyboard examined automatically.
- Debounce - Rejects unstable switch transitions.
- FIFO - Temporarily stores detected key codes.
- IRQ - Signals available keyboard information.
- SHIFT - Supplies additional key status.
- Rollover - Defines simultaneous key recognition behaviour.
π All Scanned Keyboard of 8279 MCQs
Q1. A designer connects pin 11 (GATE0) to ground to keep counter 0 disabled. Which pin should be observed to confirm that counter 0 is not counting?
π Explanation: Pin 10 carries the OUT0 signal from counter 0. When GATE0 is forced low, the counter is held and no counting occurs, but the output pin still reflects the counter state. Observing Pin 10 lets the designer verify that the output remains inactive, confirming the counter is disabled. Pin 12 is simply ground, Pin 21 (CS) and Pin 22 (RD) control device enable and read operations, not the counting status. Therefore Pin 10 is the correct indicator.
Q2. To load counter 2 with the value 5000, which control signal levels must be set on CS RD WR A1 and A0?
π Explanation: Loading a counter requires the control signals defined in the table for a load operation. For counter 2 the address bits must be A1=1 and A0=0, while CS must be active (low), RD must be high (inactive), and WR must be low to write the count value. This combination (CS=0, RD=1, WR=0, A1=1, A0=0) tells the 8253 to accept the incoming data for counter 2. The other options either use the wrong address or incorrect RD/WR levels, so they would not trigger a load for counter 2.
Q3. If both address lines A0 and A1 are high, CS is low, WR is low, and RD is high, what operation does the 8253 perform and which counter is affected?
π Explanation: When both A0 and A1 are high the device interprets the address as the control word register. With CS low the chip is enabled, WR low indicates a write operation, and RD high means no read. Consequently the 8253 performs a Write Mode Word action, updating the mode configuration rather than a specific counter. Options that suggest loading a counter or reading are incorrect because the address selects the control register, not a counter. Thus the correct choice describes writing the mode word.
Q4. Why is the CS pin described as active low and what effect does pulling CS low have?
π Explanation: The CS pin is active low, meaning that pulling it to a low voltage enables the 8253. When CS is low, the chip responds to subsequent control signals; when CS is high, the device ignores all inputs, placing its outputs in a highβimpedance state. Options stating that CS disables the device or has no effect are wrong because the chip would be inactive. The correct answer reflects the enabling function, which is essential for integrating the timer into a larger system where the processor can turn the chip on or off.
Q5. How do the address pins A0 and A1 select a specific counter or the control word register?
π Explanation: The two address pins act as a binary selector. The combination 00 selects counter 0, 01 selects counter 1, 10 selects counter 2, and 11 selects the control word register. This mapping allows the CPU to address each counter individually or program the mode word. Options that give a different mapping or claim the pins are unused are incorrect because the 8253 relies on these lines for proper selection. Understanding this selection scheme is vital when designing software that programs the timer.
Q6. What is the function of each GATE input and what occurs when a GATE pin stays high while the clock continues?
π Explanation: Each GATE input controls whether its associated counter can count. When the GATE pin is high, the counter receives clock pulses and counts; when the GATE pin is low, the counter is held in its current state regardless of clock activity. Therefore, if a GATE pin remains high while the clock continues, counting proceeds uninterrupted. Choices suggesting that the counter stops or that the GATE pin generates clock pulses are incorrect because the GATE merely enables or disables counting, not generates clocks.
Q7. What voltage is supplied to pin 24?
π Explanation: Pin 24 is designated for the power supply of the 8253 and is connected to a +5β―V source. Supplying this voltage powers the internal circuitry and defines logic levels for the device. The other options (+12β―V, ground, +3.3β―V) are incorrect because the chip is not designed to operate at those voltages; using them could damage the device or cause malfunction. Providing the correct +5β―V ensures reliable operation in typical microprocessor systems.
Q8. To program counter 1 for squareβwave mode, which control signal combination is required and which pins are used to select counter 1?
π Explanation: Programming counterβ―1 for squareβwave mode requires writing a mode word, which uses the Write Mode Word control combination: CS low, RD low, WR low, and the address bits A1=0, A0=1 to select counterβ―1. The address pins correspond to pins 19 (A0) and 20 (A1) on the package. Options that give the wrong address or RD/WR settings would either target a different counter or perform a read operation, so they would not configure the squareβwave mode correctly. The correct choice reflects the exact signal pattern needed.