📝 Two key Lockout of 8279 (9 MCQs)
Preventing Ambiguous Simultaneous Key Recognition
The two-key lockout mode of the 8279 is designed for scanned keyboards in which simultaneous key closures must not generate ambiguous input. The controller recognizes valid single-key operations through its debounce circuitry. When multiple switches are detected during the same debounce interval, the lockout logic prevents the ambiguous combination from being accepted as separate valid key entries.
Debounce Checking and Multiple-Key Detection
When a key is pressed, the controller begins debounce validation and checks subsequent keyboard scans for additional closures. If another key is detected while the first remains involved in the debounce process, the controller waits until the ambiguity is removed. A remaining valid key can then be recognized as a single operation.
FIFO Storage After a Valid Key Closure
Once an unambiguous key depression has been validated, its position code and associated SHIFT and CNTL status are entered into FIFO RAM. IRQ informs the processor when a new entry becomes available. The CPU reads the key code through the FIFO interface and processes the corresponding keyboard operation.
Example of Two Keys Pressed During Debouncing
Suppose keys K1 and K2 become closed during the same debounce interval. The controller does not treat both closures as two ordinary valid entries. It waits until only one key remains depressed and then recognizes the remaining valid key, avoiding ambiguous simultaneous key interpretation.
Applications in Calculator and Numeric Keypad Interfaces
Two-key lockout is suitable for simple keypads, numeric entry panels and calculator-style interfaces where simultaneous key combinations are not normally required. It reduces the possibility of accepting unintended combinations caused by simultaneous switch closures. The FIFO still allows the processor to retrieve previously validated entries in sequence.
Misconceptions About Two-Key Lockout Behaviour
'The first key is always accepted when two keys are pressed' oversimplifies the debounce and lockout decision. 'Two-key lockout prevents two keys from being physically pressed' is incorrect because it controls recognition rather than mechanical operation. 'Lockout eliminates the need for debounce' is incorrect because both functions work together.
Two-Key Recognition and Debounce Examination Questions
Understand the relationship between simultaneous closures, debounce checks and valid FIFO entries. Explain what happens when one key is released while another remains pressed. Compare lockout with N-key rollover and identify why two-key lockout is appropriate for ordinary single-key numeric input systems.
Keyboard Lockout and Debounce Terminology
- Two-Key Lockout - Rejects ambiguous multiple-key recognition.
- Debounce - Validates mechanical switch closure.
- Key Closure - Connects a matrix switch.
- FIFO - Stores validated keyboard entries.
- Key Position - Identifies a matrix location.
- IRQ - Reports available key information.
📝 All Two key Lockout of 8279 MCQs
Q1. In an 8253 timer circuit, which pin provides the ground connection?
📖 Explanation: Pin 12 is designated as the ground terminal for the 8253 device. Grounding this pin completes the circuit and provides a reference voltage for all internal logic. Pin 13 is an output for counter 1, Pin 21 is the chip‑select input, and Pin 24 supplies +5 V power. Using the correct ground pin prevents erratic behavior and ensures reliable timing, which is essential in any real‑world system that relies on accurate counting.
Q2. A microcontroller wants to read the current value of counter 1. Which combination of control signals must be asserted?
📖 Explanation: Reading counter 1 requires the chip‑select (CS) low to enable the device, the read line (RD) low to indicate a read operation, and the write line (WR) high so that no write occurs. The address lines A1=0 and A0=1 select counter 1 according to the table of actions. Options B and C select the wrong counter or use the wrong write state, while D disables the chip entirely. Applying the correct signals lets the CPU retrieve the count reliably.
Q3. To write a mode word to counter 0, which control‑signal settings are required?
📖 Explanation: Writing a mode word uses the active‑low chip‑select (CS=0) and write (WR=0) signals, while the read line must stay high (RD=1) to avoid a read operation. The address bits A1=0 and A0=0 identify counter 0, matching the table that defines a mode‑word write. Option B reverses WR and RD, causing a read instead of a write. Option C disables the device (CS=1). Option D asserts both WR and RD low, which is an illegal “no‑operation” state. The correct combination programs the counter’s mode correctly.
Q4. Why is the CS (chip‑select) pin defined as an active‑low signal in the 8253?
📖 Explanation: The CS pin being active‑low means the device responds when the line is driven low. This convention improves noise immunity because a low level is less likely to be mistaken for a spurious high‑frequency glitch, especially in noisy environments. While TTL compatibility and power savings are benefits of many designs, the primary reason for the active‑low choice is to make the device robust against interference. Simplified bus wiring is a secondary advantage, but noise resilience is the key factor.
Q5. How do the address lines A1 and A0 determine which counter or register is accessed?
📖 Explanation: The 8253 uses a two‑bit address (A1, A0) to choose among its three counters and the control word register. The binary code 00 points to counter 0, 01 to counter 1, and 10 to counter 2; the remaining combination 11 is reserved for the control word register. This mapping follows the table of actions and allows a CPU to address each counter directly. Options B, C, and D scramble the mapping, leading to the wrong counter being programmed or read, which would cause incorrect timing in practical applications.
Q6. What is the meaning of the “X” (undefined) entries in the control‑signal table?
📖 Explanation: The “X” entries indicate that the particular signal does not affect the operation for that row; the hardware simply ignores whatever level appears on that line. Therefore, any logical value (0 or 1) is acceptable and will not cause a reset, change output impedance, or raise a fault. Options A, C, and D describe behaviors that do not occur; the 8253 does not reset or generate faults because of undefined inputs, and its outputs remain driven as defined by the active control signals.
Q7. What voltage is supplied to the +VCC pin of the 8253?
📖 Explanation: The +VCC pin of the 8253 is powered with a regulated +5 volt supply, which is the standard operating voltage for the device. Supplying any other voltage (such as +12 V, +3.3 V, or +15 V) would exceed the device’s specifications and likely damage the internal circuitry. Maintaining the correct +5 V level ensures reliable timing and proper logic levels in real‑world hardware.
Q8. If the CS pin is inadvertently tied to ground, what is the most likely effect on the 8253?
📖 Explanation: Tying CS permanently low forces the chip‑select condition to be continuously active, meaning the 8253 will respond to every set of control signals on the bus. This makes the device always enabled, which can lead to unintended counting or mode changes when other peripherals are addressed. Options B and D suggest disabling or error generation, which does not happen because a low on CS simply keeps the device responsive. Option C describes a toggling behavior that requires additional circuitry, not a static short.
Q9. You need to generate a periodic interrupt using counter 0. Which pins and settings should be used?
📖 Explanation: For a periodic interrupt, the clock input must receive a regular pulse; pin 10 (OUT0) provides the output that can be routed back as a clock or driven externally. Pin 11 (GATE0) must be held low (logic 0) to enable counting continuously. The mode word is written by pulling WR low while CS is low and selecting counter 0 with A1=0, A0=0. Option B mis‑uses the gate pin and disables the device, Option C forces the counter high permanently, and Option D omits the required pins, so only option A correctly configures the hardware for reliable periodic interrupts.